2022-12-20 08:30:58 +03:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
2022-12-20 12:27:47 +03:00
|
|
|
|
namespace RhSolutions.Models
|
2022-12-20 08:30:58 +03:00
|
|
|
|
{
|
|
|
|
|
public class Product
|
|
|
|
|
{
|
|
|
|
|
public string ProductLine { get; set; }
|
|
|
|
|
public string ProductSku { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj as Product == null)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
Product other = obj as Product;
|
|
|
|
|
|
|
|
|
|
return ProductLine == other.ProductLine &&
|
|
|
|
|
ProductSku == other.ProductSku &&
|
|
|
|
|
Name == other.Name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
string[] properties = new[]
|
|
|
|
|
{
|
|
|
|
|
ProductLine,
|
|
|
|
|
ProductSku,
|
|
|
|
|
Name
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return string.Concat(properties.Where(p => p != null)).GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|