using System; namespace BS.Shared.DataContracts { public partial class ServiceCategoryDC : IComparable { public override bool Equals(object obj) { if (obj is ServiceCategoryDC) { var y = (ServiceCategoryDC)obj; if (this.ServiceCategoryOid == null && y.ServiceCategoryOid == null) { return this.GetHashCode() == y.GetHashCode(); } if (this.ServiceCategoryOid != null && y.ServiceCategoryOid != null) { return this.ServiceCategoryOid == y.ServiceCategoryOid; } } return false; } public override int GetHashCode() { return this.ServiceCategoryOid.HasValue ? this.GetType().Name.GetHashCode() ^ this.ServiceCategoryOid.GetHashCode() : base.GetHashCode(); } public override string ToString() { return this.Name; } public int CompareTo(object obj) { var category2 = obj as ServiceCategoryDC; if (category2 == null || String.IsNullOrEmpty(category2.Name)) return -1; if (String.IsNullOrEmpty(Name)) return 1; return Name.CompareTo(category2.Name); } } }