0
|
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 }
|