public Task <ActionResult> DeleteUserByIdAsync(DeleteUserByIdParameters parameters, [FromServices] IDeleteUserByIdHandler handler, CancellationToken cancellationToken) { if (handler is null) { throw new ArgumentNullException(nameof(handler)); } return(InvokeDeleteUserByIdAsync(parameters, handler, cancellationToken)); }
public Task <DeleteUserByIdResult> ExecuteAsync(DeleteUserByIdParameters parameters, CancellationToken cancellationToken = default) { if (parameters is null) { throw new System.ArgumentNullException(nameof(parameters)); } return(InvokeExecuteAsync(parameters, cancellationToken)); }
public Task <DeleteUserByIdResult> ExecuteAsync(DeleteUserByIdParameters parameters, CancellationToken cancellationToken = default) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } if (parameters.Id == Guid.Parse("77a33260-0007-441f-ba60-b0a833803fab")) { return(Task.FromResult(DeleteUserByIdResult.NotFound($"Can't find user with id={parameters.Id}"))); } return(InvokeExecuteAsync(parameters, cancellationToken)); }
private static async Task <ActionResult> InvokeDeleteUserByIdAsync(DeleteUserByIdParameters parameters, IDeleteUserByIdHandler handler, CancellationToken cancellationToken) { return(await handler.ExecuteAsync(parameters, cancellationToken)); }
public Task <DeleteUserByIdResult> ExecuteAsync(DeleteUserByIdParameters parameters, CancellationToken cancellationToken = default) { return(Task.FromResult(DeleteUserByIdResult.Ok("Hallo world"))); }
private async Task <DeleteUserByIdResult> InvokeExecuteAsync(DeleteUserByIdParameters parameters, CancellationToken cancellationToken) { return(await Task.FromResult("User deleted.")); }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously private async Task <DeleteUserByIdResult> InvokeExecuteAsync(DeleteUserByIdParameters parameters, CancellationToken cancellationToken) #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously { throw new System.NotImplementedException(); }