Beispiel #1
0
        public async Task <IHttpActionResult> MethodQueue(string param1)
        {
            var correlationId = TraceCorrelation.RetrieveCorrelationInfo();
            var absoluteUrl   = Request?.RequestUri?.AbsoluteUri;

            //var requestTypeToLog = absoluteUrl + "; Param1: " + param1 +"; " + correlationId;

            WebApiEventSource.Current.ServiceRequestStart(absoluteUrl, correlationId, "One");

            var serviceProxy = _queueProxy.CreateSingletonServiceProxy();
            await serviceProxy.StartScheduledMaterializedViewProcessing(param1);

            WebApiEventSource.Current.ServiceRequestStop(absoluteUrl, correlationId);
            return(Ok("Return from API method 1"));
        }
        /// <summary>
        /// Handles the exception
        /// </summary>
        /// <param name="context"></param>
        public override void Handle(ExceptionHandlerContext context)
        {
            var exception = context.Exception;

            if (context.Handle(exception))
            {
                return;
            }
            var correlationId = TraceCorrelation.RetrieveCorrelationInfo();

            if (exception.InnerException != null)
            {
                var errorMessage = exception.InnerException.Message;
                var stackTrace   = exception.InnerException.StackTrace ?? "No stack trace available";
            }
        }
Beispiel #3
0
        public async Task <IHttpActionResult> Method1(string param1)
        {
            var correlationId = TraceCorrelation.RetrieveCorrelationInfo();
            var absoluteUrl   = Request?.RequestUri?.AbsoluteUri;

            //var requestTypeToLog = absoluteUrl + "; Param1: " + param1 +"; " + correlationId;

            WebApiEventSource.Current.ServiceRequestStart(absoluteUrl, correlationId, "One");
            try
            {
                var serviceProxy = _service1Proxy.CreateSingletonServiceProxy();
                var organization = await serviceProxy.Service1Method1(param1);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }


            WebApiEventSource.Current.ServiceRequestStop(absoluteUrl, correlationId);
            return(Ok("Return from API method 1"));
        }