Ejemplo n.º 1
0
 private object InvokeSyncMethod(HttpRequest request, ServiceMethodInfo methodInfo, object service, object[] arguments)
 {
     if (methodInfo.IsAsyncAwait)
     {
         object obj = OwaServiceMethodDispatcher.InvokeMethod(request, methodInfo.SyncMethod, service, arguments);
         return(methodInfo.GenericAsyncTaskMethod.Invoke(null, new object[]
         {
             obj
         }));
     }
     return(OwaServiceMethodDispatcher.InvokeMethod(request, methodInfo.SyncMethod, service, arguments));
 }
Ejemplo n.º 2
0
        private IAsyncResult InternalInvokeBeginMethod(ServiceMethodInfo methodInfo, object service, HttpRequest httpRequest, AsyncCallback asyncCallback, object[] arguments)
        {
            int    num     = (arguments != null) ? arguments.Length : 0;
            object request = (num > 0) ? arguments[0] : null;

            this.inspector.AfterReceiveRequest(httpRequest, methodInfo.Name, request);
            if (methodInfo.ShouldAutoDisposeRequest && arguments != null)
            {
                this.delayedDisposalRequestObjects = arguments;
            }
            IAsyncResult result = null;

            using (CpuTracker.StartCpuTracking("BEGIN"))
            {
                object[] invokeArgs = this.ConstructAsyncInvokeArguments(arguments, asyncCallback);
                OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate()
                {
                    result = (IAsyncResult)OwaServiceMethodDispatcher.InvokeMethod(httpRequest, methodInfo.BeginMethod, service, invokeArgs);
                }, new Func <Exception, bool>(this.CanIgnoreExceptionForWatsonReport));
            }
            return(result);
        }