29 lines
778 B
C#
29 lines
778 B
C#
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();
|
|
}
|
|
} |