Exemplo n.º 1
0
 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 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));
        }