0
|
1 using BLToolkit.Data;
|
|
2 using BLToolkit.TypeBuilder;
|
|
3
|
|
4 namespace BLToolkit.DataAccess
|
|
5 {
|
|
6 public abstract class DataAccessor<T,TA> : DataAccessor<T>
|
|
7 where TA : DataAccessor<T>
|
|
8 {
|
|
9 #region Constructors
|
|
10
|
|
11 [System.Diagnostics.DebuggerStepThrough]
|
|
12 protected DataAccessor()
|
|
13 {
|
|
14 }
|
|
15
|
|
16 [System.Diagnostics.DebuggerStepThrough]
|
|
17 protected DataAccessor(DbManager dbManager)
|
|
18 : base(dbManager)
|
|
19 {
|
|
20 }
|
|
21
|
|
22 #endregion
|
|
23
|
|
24 #region CreateInstance
|
|
25
|
|
26 public static TA CreateInstance()
|
|
27 {
|
|
28 return TypeFactory.CreateInstance<TA>();
|
|
29 }
|
|
30
|
|
31 public static TA CreateInstance(DbManager dbManager)
|
|
32 {
|
|
33 return CreateInstance(dbManager, false);
|
|
34 }
|
|
35
|
|
36 public static TA CreateInstance(DbManager dbManager, bool dispose)
|
|
37 {
|
|
38 TA da = TypeFactory.CreateInstance<TA>();
|
|
39
|
|
40 da.SetDbManager(dbManager, dispose);
|
|
41
|
|
42 return da;
|
|
43 }
|
|
44
|
|
45 #endregion
|
|
46 }
|
|
47 }
|