} // ExecuteEnumerable public virtual SafeReader GetFirst(ConnectionWrapper oConnectionToUse = null) { if (!IsReadyToGo()) { throw new ArgumentOutOfRangeException("Parameters are invalid for " + GetName(), (Exception)null); } QueryParameter[] args = PrepareParameters(); SafeReader res = DB.GetFirst(oConnectionToUse, GetName(), Species, args); FillOutputs(args); return(res); } // GetFirst
} // Count public SafeReader ToCache() { var sr = new SafeReader(null, null, false, true); if (ReferenceEquals(m_oRow, null) && ReferenceEquals(m_oReader, null)) { return(sr); } for (int i = 0; i < Count; i++) { sr.m_oCache.Add(GetName(i), this[i]); } return(sr); } // ToCache
} // GetFirst public virtual SafeReader GetFirst(ConnectionWrapper oConnectionToUse, string sQuery, CommandSpecies nSpecies, params QueryParameter[] aryParams) { SafeReader oResult = null; ForEachRowSafe( oConnectionToUse, (sr, bRowsetStart) => { oResult = sr.ToCache(); return(ActionResult.SkipAll); }, sQuery, nSpecies, aryParams ); return(oResult ?? SafeReader.CreateEmpty()); } // GetFirst
} // ForEachResult public static void ForEachResult <T>( this DbCommand cmd, Func <T, ActionResult> oAction, Action oLogExecution = null ) where T : IResultRow, new() { if (ReferenceEquals(oAction, null)) { throw new DbException("Callback action not specified in 'ForEachResult' call."); } Run( cmd, (oReader, bRowSetStart) => { var sr = new SafeReader(oReader); T oResult = sr.Fill <T>(); oResult.SetIsFirst(bRowSetStart); return(oAction(oResult)); }, oLogExecution ); } // ForEachResult
public SafeReaderFluentInterface(SafeReader oReader) { m_oReader = oReader; Reset(); } // constructor