public UsersController( ShowUserService showUserService, AddUserService addUserService, UpdateUserService updateUserService, DeleteUserService deleteUserService) { _showUserService = showUserService; _addUserService = addUserService; _updateUserService = updateUserService; _deleteUserService = deleteUserService; }
Delete([FromServices] DeleteUserService _delete, int Id) { try { var deletedUser = await _delete.Execute(Id); return(new UserView(deletedUser)); } catch (Exception e) { return(BadRequest(e.Message)); } }