/// <summary> /// Copies the properties from another AuditDetail object to this AuditDetail object /// </summary> /// <param name="target">The target.</param> /// <param name="source">The source.</param> public static void CopyPropertiesFrom(this AuditDetail target, AuditDetail source) { target.AuditId = source.AuditId; target.Property = source.Property; target.OriginalValue = source.OriginalValue; target.CurrentValue = source.CurrentValue; target.Id = source.Id; target.Guid = source.Guid; }
/// <summary> /// Clones this AuditDetail object to a new AuditDetail object /// </summary> /// <param name="source">The source.</param> /// <param name="deepCopy">if set to <c>true</c> a deep copy is made. If false, only the basic entity properties are copied.</param> /// <returns></returns> public static AuditDetail Clone(this AuditDetail source, bool deepCopy) { if (deepCopy) { return(source.Clone() as AuditDetail); } else { var target = new AuditDetail(); target.CopyPropertiesFrom(source); return(target); } }
/// <summary> /// Clones this AuditDetail object to a new AuditDetail object with default values for the properties in the Entity and Model base classes. /// </summary> /// <param name="source">The source.</param> /// <returns></returns> public static AuditDetail CloneWithoutIdentity(this AuditDetail source) { var target = new AuditDetail(); target.CopyPropertiesFrom(source); target.Id = 0; target.Guid = Guid.NewGuid(); target.ForeignKey = null; target.ForeignId = null; target.ForeignGuid = null; return(target); }