* Further improvements
This commit is contained in:
29
OrdersManagement/Models/TransactionModel.cs
Normal file
29
OrdersManagement/Models/TransactionModel.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace OrdersManagement.Models;
|
||||
|
||||
public class TransactionModel : IEquatable<TransactionModel>
|
||||
{
|
||||
public string? PartNumber { get; set; }
|
||||
public string? ItemNumber { get; set; }
|
||||
public decimal? Quantity { get; set; }
|
||||
|
||||
|
||||
public bool Equals(TransactionModel? other)
|
||||
{
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return PartNumber == other.PartNumber;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((TransactionModel)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return PartNumber.GetHashCode();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user