2022-03-23 17:56:46 +03:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace RehauSku.PriceListTools
|
2022-01-28 12:27:10 +03:00
|
|
|
|
{
|
2022-03-23 17:56:46 +03:00
|
|
|
|
public class Position
|
2022-01-28 12:27:10 +03:00
|
|
|
|
{
|
|
|
|
|
public string Group { get; private set; }
|
|
|
|
|
public string Sku { get; private set; }
|
|
|
|
|
public string Name { get; private set; }
|
|
|
|
|
|
|
|
|
|
public Position(string group, string sku, string name)
|
|
|
|
|
{
|
|
|
|
|
Group = group;
|
|
|
|
|
Sku = sku;
|
|
|
|
|
Name = name;
|
|
|
|
|
}
|
2022-03-23 17:56:46 +03:00
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj as Position == null)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
Position other = obj as Position;
|
|
|
|
|
|
|
|
|
|
return Group == other.Group &&
|
|
|
|
|
Sku == other.Sku &&
|
|
|
|
|
Name == other.Name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
string[] properties = new[]
|
|
|
|
|
{
|
|
|
|
|
Group,
|
|
|
|
|
Sku,
|
|
|
|
|
Name
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return properties.Where(p => p != null).Sum(p => p.GetHashCode());
|
|
|
|
|
}
|
2022-01-28 12:27:10 +03:00
|
|
|
|
}
|
2022-01-31 17:54:18 +03:00
|
|
|
|
}
|