Пример #1
0
        public async Task <IActionResult> DeleteUserAsync(Guid userId, [FromServices] IDeleteUserCommand command)
        {
            try
            {
                await command.ExecuteAsync(userId);

                return(NoContent());
            }
            catch (Exception exception)
            {
                return(BadRequest(exception.Message));
            }
        }
Пример #2
0
 public Task <IActionResult> DeleteAsync(
     [FromServices] IDeleteUserCommand command,
     int userId,
     CancellationToken cancellationToken) => command.ExecuteAsync(userId, cancellationToken);