Example #1
0
 public T QuerySingle <T>(RequestContext context)
 {
     return(ExecuteWrap((dbSession) =>
     {
         var dataReader = CommandExecuter.ExecuteReader(dbSession, context);
         return _dataReaderDeserializer.ToSingle <T>(context, dataReader);
     }, context, DataSourceChoice.Read));
 }
Example #2
0
        public IMultipleResult InitData(RequestContext requestContext, IDataReaderWrapper dataReaderWrapper, IDataReaderDeserializer dataReaderDeserializer)
        {
            foreach (var resultMapKV in _resultDataMap)
            {
                var resultMap = resultMapKV.Value;

                switch (resultMap.Type)
                {
                case ResultMap.ResultTypeType.Single:
                {
                    resultMap.Result = dataReaderDeserializer.ToSingle(requestContext, dataReaderWrapper, resultMap.ResultType, false);
                    break;
                }

                case ResultMap.ResultTypeType.Enumerable:
                {
                    resultMap.Result = dataReaderDeserializer.ToEnumerable(requestContext, dataReaderWrapper, resultMap.ResultType, false);
                    break;
                }
                }
                dataReaderWrapper.NextResult();
            }
            return(this);
        }