public ActionResult <UserView> Delete(int id) { try { var user = _deleteUserService.Execute(id); return(Ok(new UserView(user))); } catch (Exception e) { return(BadRequest(e.Message)); } }
Delete([FromServices] DeleteUserService _delete, int Id) { try { var deletedUser = await _delete.Execute(Id); return(new UserView(deletedUser)); } catch (Exception e) { return(BadRequest(e.Message)); } }