Пример #1
0
 async Task Behavior <TInstance> .Execute(BehaviorContext <TInstance> context)
 {
     try
     {
         await _activity.Execute(context, _next).ConfigureAwait(false);
     }
     catch (Exception exception)
     {
         await ExceptionTypeCache.Faulted(_next, context, exception).ConfigureAwait(false);
     }
 }
Пример #2
0
        async Task Behavior <TInstance> .Execute <T>(BehaviorContext <TInstance, T> context)
        {
            var behavior = new DataBehavior <TInstance, T>(_next);

            try
            {
                await _activity.Execute(context, behavior).ConfigureAwait(false);
            }
            catch (Exception exception)
            {
                await ExceptionTypeCache.Faulted(behavior, context, exception).ConfigureAwait(false);
            }
        }
Пример #3
0
        async Task Behavior <TInstance> .Execute(BehaviorContext <TInstance> context)
        {
            Exception activityException = null;

            try
            {
                await _activity.Execute(context, _next);
            }
            catch (Exception exception)
            {
                activityException = exception;
            }

            // once we can await in a catch, we're golden
            if (activityException != null)
            {
                await ExceptionTypeCache.Faulted(_next, context, activityException);
            }
        }
Пример #4
0
        async Task Behavior <TInstance> .Execute <T>(BehaviorContext <TInstance, T> context)
        {
            var behavior = new DataBehavior <TInstance, T>(_next);

            Exception activityException = null;

            try
            {
                await _activity.Execute(context, behavior);
            }
            catch (Exception exception)
            {
                activityException = exception;
            }

            // once we can await in catch we're golden
            if (activityException != null)
            {
                await ExceptionTypeCache.Faulted(behavior, context, activityException);
            }
        }