internal ObjectReader(ObjectReaderSession <TDataReader> session, NamedColumn[] namedColumns, object[] globals, object[] arguments, int numberOfLocals, bool disposeSession,
                       Func <ObjectMaterializer <TDataReader>, TObject> materializeFunc)
     : base(session, namedColumns, globals, arguments, numberOfLocals)
 {
     _disposeSession  = disposeSession;
     _materializeFunc = materializeFunc;
 }
Beispiel #2
0
        public IObjectReader GetNextResult(IObjectReaderSession session, bool disposeDataReader)
        {
            ObjectReaderSession <TDataReader> ors = (ObjectReaderSession <TDataReader>)session;
            IObjectReader reader = ors.GetNextResult(_materializeFunc, _namedColumns, _globals, _numberOfLocals, disposeDataReader);

            if (reader == null && disposeDataReader)
            {
                ors.Dispose();
            }
            return(reader);
        }
 internal ObjectReaderBase(ObjectReaderSession <TDataReader> session,
                           NamedColumn[] namedColumns,
                           object[] globals,
                           object[] arguments,
                           int nLocals
                           )
     : base()
 {
     this.Session    = session;
     this.services   = session.Provider.Services;
     this.DataReader = session.DataReader;
     this.Globals    = globals;
     this.Arguments  = arguments;
     if (nLocals > 0)
     {
         this.Locals = new object[nLocals];
     }
     if (this.Session.IsBuffered)
     {
         this.Buffer();
     }
     this.Ordinals = this.GetColumnOrdinals(namedColumns);
 }
Beispiel #4
0
        public IObjectReader Create(DbDataReader dataReader, bool disposeDataReader, IReaderProvider provider, object[] parentArgs, object[] userArgs, ICompiledSubQuery[] subQueries)
        {
            ObjectReaderSession <TDataReader> session = new ObjectReaderSession <TDataReader>((TDataReader)dataReader, provider, parentArgs, userArgs, subQueries);

            return(session.CreateReader(_materializeFunc, _namedColumns, _globals, _numberOfLocals, disposeDataReader));
        }