コード例 #1
0
ファイル: Persistable.cs プロジェクト: kriznaraj/Code
        public void CopyStateAndVersion(Persistable source)
        {
            this.SetVersion(source.Version);
            switch (source.State)
            {
            case PersistableState.Deleted:
                this.Deleted();
                break;

            case PersistableState.Modified:
                this.Modified();
                break;

            case PersistableState.New:
                this.Added();
                break;

            case PersistableState.Unchanged:
            default:
                throw new InvalidOperationException();
            }
        }
コード例 #2
0
ファイル: Persistable.cs プロジェクト: kriznaraj/Code
 /// <summary>
 /// Instantiates the new instance of persistable object from the existing object by copying the state and version from the existing object
 /// </summary>
 /// <param name="persistable">Persistable object to be copied from</param>
 public Persistable(Persistable persistable)
     : this(persistable.State, persistable.Version)
 {
 }