public async Task <string> Service1Method1(string param1) { try { var x = 1; var y = 0; if (y == 0) { return((x / y).ToString()); } var correlationId = TraceCorrelation.GetCurrentActivityId(); ServiceEventSource.Current.ServiceRequestStart("Service1Method1", correlationId); ServiceEventSource.Current.ServiceRequestStart1(correlationId, "Service1Method1"); var proxy = _statelessService2ProxyFactory.CreateSingletonServiceProxy(); var result = await proxy.Service2Method1(param1); ServiceEventSource.Current.ServiceRequestStop("Service1Method1", correlationId); return(result); } catch (Exception e) { Console.WriteLine(e); throw; } }
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")); }
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")); }