public Task <ActionResult> PostUserAsync(PostUserParameters parameters, [FromServices] IPostUserHandler handler, CancellationToken cancellationToken) { if (handler is null) { throw new ArgumentNullException(nameof(handler)); } return(InvokePostUserAsync(parameters, handler, cancellationToken)); }
public Task <PostUserResult> ExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken = default) { if (parameters is null) { throw new System.ArgumentNullException(nameof(parameters)); } return(InvokeExecuteAsync(parameters, cancellationToken)); }
private static async Task <ActionResult> InvokePostUserAsync(PostUserParameters parameters, IPostUserHandler handler, CancellationToken cancellationToken) { return(await handler.ExecuteAsync(parameters, cancellationToken)); }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously private async Task <PostUserResult> InvokeExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken) #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously { throw new System.NotImplementedException(); }
public Task <PostUserResult> ExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken = default) { return(Task.FromResult(PostUserResult.Created())); }
private async Task <PostUserResult> InvokeExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken) { return(await Task.FromResult(PostUserResult.Created())); }