I can't use Except method of List, why?Code:interface IValidationData : IEquatable<IValidationData> { } class Customer : IValidationData { public string Name { get; set; } public int Age { get; set; } public bool Equals(IValidationData otherValue) { Customer other = otherValue as Customer; if (!Name.Equals(other.Name)) return false; if (!Age.Equals(other.Age)) return false; return true; } public override int GetHashCode() { return Name.GetHashCode() ^ Age.GetHashCode(); } } List<Customer> list1 = new List<Customer>(); List<Customer> list2 = new List<Customer>(); List<Customer> list3 = list2.Except(list1).ToList(); // This line is not working why?




Reply With Quote
