diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2022-12-20 12:27:47 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2022-12-20 12:27:47 +0300 |
commit | 73569a43644309d0342817580bcfd86c1face5b8 (patch) | |
tree | f3c6e15db82130b02ec8c3fa1b64674e6a9cf48d /src/Models/Product.cs | |
parent | 3d186c22e8665b80839495fdcf4b176c2f3e03b9 (diff) |
Namespace refactoring
Diffstat (limited to 'src/Models/Product.cs')
-rw-r--r-- | src/Models/Product.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Models/Product.cs b/src/Models/Product.cs new file mode 100644 index 0000000..2f092d1 --- /dev/null +++ b/src/Models/Product.cs @@ -0,0 +1,35 @@ +using System.Linq; + +namespace RhSolutions.Models +{ + 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 |