public async Task <IActionResult> DeleteUserAsync(Guid userId, [FromServices] IDeleteUserCommand command) { try { await command.ExecuteAsync(userId); return(NoContent()); } catch (Exception exception) { return(BadRequest(exception.Message)); } }
public Task <IActionResult> DeleteAsync( [FromServices] IDeleteUserCommand command, int userId, CancellationToken cancellationToken) => command.ExecuteAsync(userId, cancellationToken);