public IActionResult Delete(DeleteAlbumViewModel model)
 {
     _albumAppService.Delete(model.Id);
     return(Json(new JsonResultEntity()
     {
         Message = "删除成功",
         JsonObject = Json(new AlbumViewModel()
         {
             Id = model.Id
         })
     }));
 }
Beispiel #2
0
 public IActionResult Delete(long id)
 {
     try
     {
         App.Delete(id);
         return(StatusCode(204));
     }
     catch (EntityNotFoundException ex)
     {
         return(StatusCode(404, ex.ToString()));
     }
     catch (InternalServerException ex)
     {
         return(StatusCode(500, ex.ToString()));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex.ToString()));
     }
 }