aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs37
1 files changed, 6 insertions, 31 deletions
diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs
index 2ab8daf..e8292fd 100644
--- a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs
+++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs
@@ -28,14 +28,14 @@ using TribalMedia.Framework.Data;
28 28
29namespace TribalMedia.Framework.Data 29namespace TribalMedia.Framework.Data
30{ 30{
31 public abstract class RowMapper 31 public abstract class BaseRowMapper
32 { 32 {
33 public abstract void FillObject(DataReader reader); 33 public abstract void FillObject(BaseDataReader reader);
34 } 34 }
35 35
36 public class ObjectMapper<TObj> : RowMapper 36 public class BaseRowMapper<TObj> : BaseRowMapper
37 { 37 {
38 private readonly Schema m_schema; 38 private readonly BaseSchema m_schema;
39 private readonly TObj m_obj; 39 private readonly TObj m_obj;
40 40
41 public TObj Object 41 public TObj Object
@@ -43,38 +43,13 @@ namespace TribalMedia.Framework.Data
43 get { return m_obj; } 43 get { return m_obj; }
44 } 44 }
45 45
46 public ObjectMapper(Schema schema, TObj obj) 46 public BaseRowMapper(BaseSchema schema, TObj obj)
47 { 47 {
48 m_schema = schema; 48 m_schema = schema;
49 m_obj = obj; 49 m_obj = obj;
50 } 50 }
51 51
52 public override void FillObject(DataReader reader) 52 public override void FillObject(BaseDataReader reader)
53 {
54 foreach (BaseFieldMapper fieldMapper in m_schema.Fields.Values)
55 {
56 fieldMapper.SetPropertyFromReader(m_obj, reader);
57 }
58 }
59 }
60
61 public class RowMapper<TObj> : RowMapper
62 {
63 private readonly Schema m_schema;
64 private readonly TObj m_obj;
65
66 public TObj Object
67 {
68 get { return m_obj; }
69 }
70
71 public RowMapper(Schema schema, TObj obj)
72 {
73 m_schema = schema;
74 m_obj = obj;
75 }
76
77 public override void FillObject(DataReader reader)
78 { 53 {
79 foreach (BaseFieldMapper fieldMapper in m_schema.Fields.Values) 54 foreach (BaseFieldMapper fieldMapper in m_schema.Fields.Values)
80 { 55 {