/// <summary> /// Executes asyncronous processor with decoration. /// </summary> /// <param name="context">The processor context.</param> /// <returns>The <see cref="Task"/></returns> public async Task ExecuteAsync(TContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } await BeforeExecuteAsync(context); await processor.ExecuteAsync(context); await AfterExecuteAsync(context); }
internal static async Task ExecuteAsyncWithProgress(this IAsyncProcessor processor, bool throwOnError, object state) { if (ExecuteAsyncWithProgressAction != null) { await ExecuteAsyncWithProgressAction(processor, throwOnError, state).ConfigureAwait(false); } else { await processor.ExecuteAsync(null).ConfigureAwait(false); } if (processor.Exception != null && throwOnError) { throw processor.Exception; } }