public virtual T Clone <T>() where T : DbObject, new() { T local = DbObjectTools.Clone <T>(this); CloneUtils.CloneObject <DbObjectState>(this.State, local.State, new Expression <Func <DbObjectState, object> > [0]); CloneUtils.CloneObject <DbObjectState>(this.previousState, local.previousState, new Expression <Func <DbObjectState, object> > [0]); return(local); }
public virtual void OnWrote(object sender, DbEventArgs e) { this.State.ObjectWrote = true; this.State.ModifiedValues.Clear(); this.State.UpdateInitialValues(this); this.previousState = DbObjectTools.Clone <DbObjectState>(this.State); e.Operator.TranscationRollback -= new EventHandler(this.OnTranscationRollback); e.Operator.TranscationRollback += new EventHandler(this.OnTranscationRollback); e.Operator.TranscationCommit -= new EventHandler(this.OnTranscationCommit); e.Operator.TranscationCommit += new EventHandler(this.OnTranscationCommit); }