public virtual IAsyncResult BeginExecuteReader(AsyncCallback callback, object state, CommandBehavior behavior) { if (IsTraced) { Tracer.Instance.EnterFunction(TraceClass, "AsyncExecuteReader", new string[] { "CommandText", "callback", "state", "behavior", "Parameters" }, new object[] { this.CommandText, callback, state, behavior, this.GetTraceParameters(true) }); } this.AsyncExecuteReader = new AsyncExecuteReaderHandler(this.ExecuteReader); return(this.AsyncExecuteReader.BeginInvoke(behavior, callback, state)); }
public virtual DbDataReader EndExecuteReader(IAsyncResult asyncResult) { ParameterChecker.CheckNull("DbAccessCommand.EndExecuteReader", "AsyncExecuteReader", this.AsyncExecuteReader); ParameterChecker.CheckNull("DbAccessCommand.EndExecuteReader", "asyncResult", asyncResult); DbDataReader result = this.AsyncExecuteReader.EndInvoke(asyncResult); this.AsyncExecuteReader = null; if (IsTraced) { Tracer.Instance.LeaveFunction(TraceClass, "AsyncExecuteReader", new string[] { "asyncResult", "result", "Parameters" }, new object[] { "Null:" + (asyncResult == null), "Null:" + (result == null), this.GetTraceParameters(false) }); } return(result); }