public object Clone()
 {
     return(new DbDiffEntry
     {
         DbEntryBefore = (DbEntry)DbEntryBefore?.Clone(),
         DbEntryAfter = (DbEntry)DbEntryAfter?.Clone()
     });
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = 13;
         hashCode = (hashCode * 397) ^ (DbEntryBefore != null ? DbEntryBefore.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DbEntryAfter != null ? DbEntryAfter.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public int CompareTo(DbDiffEntry other)
        {
            var viewNameCompare = string.Compare(ViewName, other.ViewName, StringComparison.InvariantCulture);

            if (viewNameCompare != 0)
            {
                return(viewNameCompare);
            }
            var businessIdCompare = GetBusinessIdHashCode().CompareTo(other.GetBusinessIdHashCode());

            if (businessIdCompare != 0)
            {
                return(businessIdCompare);
            }
            var typeCompare = ((int)DiffEntryType).CompareTo((int)(other.DiffEntryType));

            if (typeCompare != 0)
            {
                return(typeCompare);
            }
            if (DbEntryBefore != null)
            {
                var beforeCompare = DbEntryBefore.CompareTo(other.DbEntryBefore);
                if (beforeCompare != 0)
                {
                    return(beforeCompare);
                }
            }
            if (DbEntryAfter != null)
            {
                var afterCompare = DbEntryAfter.CompareTo(other.DbEntryAfter);
                if (afterCompare != 0)
                {
                    return(afterCompare);
                }
            }
            return(0);
        }