From 5e757d2ad1ae3ad158a9b5f6077abcfaf9fac616 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 16 Jan 2008 12:25:13 +0000 Subject: * More work on getting the database framework to actually work --- .../TribalMedia.Framework.Data/BaseRowMapper.cs | 37 ++++------------------ 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'ThirdParty/TribalMedia/TribalMedia.Framework.Data/BaseRowMapper.cs') 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; namespace TribalMedia.Framework.Data { - public abstract class RowMapper + public abstract class BaseRowMapper { - public abstract void FillObject(DataReader reader); + public abstract void FillObject(BaseDataReader reader); } - public class ObjectMapper : RowMapper + public class BaseRowMapper : BaseRowMapper { - private readonly Schema m_schema; + private readonly BaseSchema m_schema; private readonly TObj m_obj; public TObj Object @@ -43,38 +43,13 @@ namespace TribalMedia.Framework.Data get { return m_obj; } } - public ObjectMapper(Schema schema, TObj obj) + public BaseRowMapper(BaseSchema schema, TObj obj) { m_schema = schema; m_obj = obj; } - public override void FillObject(DataReader reader) - { - foreach (BaseFieldMapper fieldMapper in m_schema.Fields.Values) - { - fieldMapper.SetPropertyFromReader(m_obj, reader); - } - } - } - - public class RowMapper : RowMapper - { - private readonly Schema m_schema; - private readonly TObj m_obj; - - public TObj Object - { - get { return m_obj; } - } - - public RowMapper(Schema schema, TObj obj) - { - m_schema = schema; - m_obj = obj; - } - - public override void FillObject(DataReader reader) + public override void FillObject(BaseDataReader reader) { foreach (BaseFieldMapper fieldMapper in m_schema.Fields.Values) { -- cgit v1.1