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

                return(new UserView(deletedUser));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }