1
0

31 lines
642 B
C#
Raw Normal View History

2025-01-14 05:59:55 +00:00
using CsvHelper.Configuration.Attributes;
namespace RhSolutions.SkuParser.Models;
public class ProductQuantity
{
[Index(0)]
public required Product Product { get; set; }
[Index(1)]
public required double Quantity { get; set; }
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
ProductQuantity other = (ProductQuantity)obj;
return Product == other.Product &&
Quantity == other.Quantity;
}
public override int GetHashCode()
{
HashCode hash = new();
hash.Add(Product);
hash.Add(Quantity);
return hash.ToHashCode();
}
}