public virtual void Clone(DbObject srcObj, bool notifyChanged = true) { if (!notifyChanged) { this.SuspendNotify(); } CloneUtils.CloneObject <DbObject>(srcObj, this, new Expression <Func <DbObject, object> > [0]); CloneUtils.CloneObject <DbObjectState>(this.State, this.State, new Expression <Func <DbObjectState, object> > [0]); CloneUtils.CloneObject <DbObjectState>(this.previousState, this.previousState, new Expression <Func <DbObjectState, object> > [0]); if (!notifyChanged) { this.ResumeNotify(); } }
public void UpdateInitialValues(DbObject obj) { this.initialValues.Clear(); DbObjectInfo dbObjectInfo = this.GetDbObjectInfo(obj.GetType()); foreach (KeyValuePair <string, DynamicPropertyInfo> pair in dbObjectInfo.DynamicPropertyInfos) { string key = pair.Key; object obj2 = obj.GetValue(key); ValueInfo info2 = new ValueInfo { Value = obj2, Name = key }; this.initialValues.Add(key, info2); } }
public virtual bool Compare(DbObject obj) { return(DbObjectTools.Compare(this, obj)); }