Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CustomerViewModel
- {
- public int CustomerID { get; set; }
- public String Name { get; set; }
- public int Count { get; set; }
- public override string ToString()
- {
- return Name;
- }
- public override bool Equals(object obj)
- {
- if (obj is Customer)
- {
- var c = (CustomerViewModel)obj;
- return c.CustomerID == this.CustomerID;
- }
- else
- {
- return false;
- }
- }
- public override int GetHashCode()
- {
- return CustomerID.GetHashCode();
- }
- }
Add Comment
Please, Sign In to add comment