Mercurial > pub > bltoolkit
comparison Demo/WinForms/ObjectModel/BizEntity.cs @ 0:f990fcb411a9
Копия текущей версии из github
| author | cin |
|---|---|
| date | Thu, 27 Mar 2014 21:46:09 +0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:f990fcb411a9 |
|---|---|
| 1 using System; | |
| 2 | |
| 3 using BLToolkit.DataAccess; | |
| 4 using BLToolkit.EditableObjects; | |
| 5 using BLToolkit.Mapping; | |
| 6 using BLToolkit.Reflection; | |
| 7 | |
| 8 namespace BLToolkit.Demo.ObjectModel | |
| 9 { | |
| 10 public abstract class BizEntity : EditableObject | |
| 11 { | |
| 12 [PrimaryKey(0), NonUpdatable] | |
| 13 public abstract int ID { get; protected internal set; } | |
| 14 | |
| 15 public virtual BizEntity CopyTo(BizEntity obj) | |
| 16 { | |
| 17 Map.ObjectToObject(this, obj); | |
| 18 | |
| 19 return obj; | |
| 20 } | |
| 21 | |
| 22 public virtual BizEntity Clone() | |
| 23 { | |
| 24 BizEntity obj = (BizEntity)TypeAccessor.CreateInstanceEx(GetType()); | |
| 25 | |
| 26 CopyTo(obj); | |
| 27 obj.AcceptChanges(); | |
| 28 | |
| 29 return obj; | |
| 30 } | |
| 31 } | |
| 32 } |
