示例#1
0
 internal MapperContext(DataMapper mapper, IDataReader rdr, Type toType)
 {
     Mapper     = mapper;
     DataReader = rdr;
     ObjectType = toType;
 }
示例#2
0
        internal static IEnumerable <KeyValuePair <string, IQueryValue> > GetChangeset(object o, DataMapper dtoMapper)
        {
            if (o == null)
            {
                yield break;
            }
            var oType  = o.GetType();
            var schema = (dtoMapper ?? DataMapper.Instance).GetSchema(oType);

            foreach (var columnMapping in schema.Columns)
            {
                if (columnMapping.IsReadOnly || columnMapping.GetVal == null)
                {
                    continue;
                }
                var pVal    = columnMapping.GetVal(o);
                var qVal    = pVal is IQueryValue ? (IQueryValue)pVal : new QConst(pVal);
                var fldName = columnMapping.ColumnName;
                yield return(new KeyValuePair <string, IQueryValue>(fldName, qVal));
            }
        }
示例#3
0
 internal SelectQuery(DbDataAdapter adapter)
 {
     Adapter   = adapter;
     DtoMapper = DataMapper.Instance;
 }
 internal SelectQuery(DbDataAdapter adapter)
 {
     Adapter     = adapter;
     DtoMapper   = DataMapper.Instance;
     ApplyOffset = Adapter.ApplyOffset;
 }