1234567891011121314151617181920212223242526272829303132333435 |
- using Ant.Core;
- using Ant.Mapper;
- using Ant.ORM;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- namespace Ant.Query.Mapping
- {
- public class MappingField : IObjectActivatorCreator
- {
- Type _type;
- public MappingField(Type type, int readerOrdinal)
- {
- this._type = type;
- this.ReaderOrdinal = readerOrdinal;
- }
- public int ReaderOrdinal { get; private set; }
- public int? CheckNullOrdinal { get; set; }
- public IObjectActivator CreateObjectActivator()
- {
- return this.CreateObjectActivator(null);
- }
- public IObjectActivator CreateObjectActivator(AntORM dbContext)
- {
- Func<IDataReader, int, object> fn = MappingTypeConstructor.GetInstance(this._type).InstanceCreator;
- MappingFieldActivator act = new MappingFieldActivator(fn, this.ReaderOrdinal);
- return act;
- }
- }
- }
|