Example #1
0
 /// <summary>
 /// Ends the event for asynchronous interceptions.
 /// </summary>
 private static void EndAsyncAuditInterceptEvent(Task task, IInvocation invocation, InterceptEvent intEvent, IAuditScope scope, object result)
 {
     intEvent.AsyncStatus = task.Status.ToString();
     if (task.Status == TaskStatus.Faulted)
     {
         intEvent.Exception = task.Exception?.GetExceptionInfo();
     }
     else if (task.Status == TaskStatus.RanToCompletion)
     {
         SuccessAuditInterceptEvent(invocation, intEvent, result);
     }
     scope.Dispose();
 }
Example #2
0
 private void EndScope()
 {
     _currentScope?.Dispose();
 }