Skip to content

Commit

Permalink
Changed logic equality logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarincev committed Jun 6, 2018
1 parent 649d320 commit 46bda8c
Show file tree
Hide file tree
Showing 4 changed files with 1,570 additions and 95 deletions.
22 changes: 20 additions & 2 deletions VirtoCommerce.Storefront.Model/Address.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using VirtoCommerce.Storefront.Model.Common;

Expand Down Expand Up @@ -34,5 +32,25 @@ public override string ToString()
var retVal = string.Join(" ", FirstName, LastName, Organization, Line1, City, RegionName, PostalCode, CountryName);
return retVal;
}

protected override IEnumerable<object> GetEqualityComponents()
{
//Key and Name properties don't participate in equality
yield return Type;
yield return Organization;
yield return CountryCode;
yield return CountryName;
yield return PostalCode;
yield return Zip;
yield return Line1;
yield return Line2;
yield return RegionId;
yield return RegionName;
yield return FirstName;
yield return MiddleName;
yield return LastName;
yield return Phone;
yield return Email;
}
}
}
Loading

0 comments on commit 46bda8c

Please sign in to comment.