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