コード例 #1
0
 /// <summary>
 /// Equality method between two objects of the same type.
 /// Because the Equals method is strongly typed by generic constraints,
 /// it is not necessary to test for the correct object type.
 /// For safety we just want to match on business key value - in this case the fields
 /// that cannot be different between the two objects if they are supposedly equal.
 /// </summary>
 /// <param name="obj">The other object of this type that we are testing equality with</param>
 /// <returns></returns>
 public virtual bool Equals(GetFullOutputDtoBase <TIdType> obj)
 {
     if (obj != null)
     {
         return(Id.Equals(obj.Id) && Culture.Equals(obj.Culture) &&
                IsActive.Equals(obj.IsActive) &&
                DescriptionFull.Equals(obj.DescriptionFull) &&
                CreationTime.Equals(obj.CreationTime) &&
                CreatorUserId.Equals(obj.CreatorUserId) &&
                CreatorUserName.Equals(obj.CreatorUserName) &&
                LastModifierUserId.Equals(obj.LastModifierUserId) &&
                LastModifierUserName.Equals(obj.LastModifierUserName) &&
                LastModificationTime.Equals(obj.LastModificationTime)
                );
     }
     return(false);
 }
コード例 #2
0
 /// <summary>
 /// Comparison method between two objects of the same type, used for sorting.
 /// Because the CompareTo method is strongly typed by generic constraints,
 /// it is not necessary to test for the correct object type.
 /// </summary>
 /// <param name="other">The other object of this type we are comparing to</param>
 /// <returns></returns>
 public virtual int CompareTo(GetFullOutputDtoBase <TIdType> other)
 {
     // put comparison of properties in here
     // for base object we'll just sort by name and description short
     return(Name.CompareTo(other.Name));
 }