diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2022-12-20 08:30:58 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2022-12-20 08:30:58 +0300 |
commit | 3c7e24ecfe34291e551046bf5c8f1d95ea37af7e (patch) | |
tree | fe1f8f07bb3cf53c3449aabc14cf7845b21a9c4d /src/PriceListTools/Product.cs | |
parent | 598ffe0d3c8ce810bd50039eedb3634e0433e6da (diff) |
Rename Position to Product
Diffstat (limited to 'src/PriceListTools/Product.cs')
-rw-r--r-- | src/PriceListTools/Product.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/PriceListTools/Product.cs b/src/PriceListTools/Product.cs new file mode 100644 index 0000000..e631293 --- /dev/null +++ b/src/PriceListTools/Product.cs @@ -0,0 +1,35 @@ +using System.Linq; + +namespace RhSolutions.PriceListTools +{ + 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(); + } + } +}
\ No newline at end of file |