blob: 34b7b93a16aa7b277fc42ad3353b266cff22347b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
using System.Linq;
namespace RehauSku.PriceListTools
{
public class Position
{
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;
}
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());
}
}
}
|