/// <summary> /// Redirects to the Delete page in the Album folder. /// </summary> /// <returns>Rendered view to the response.</returns> public IActionResult Delete() { var viewModel = new DeleteAlbumViewModel(); viewModel.Albums = this.albumService.GetAll(); return(this.View(viewModel)); }
public IActionResult Delete(int albumId) { var viewModel = new DeleteAlbumViewModel(); viewModel.Albums = this.albumService.GetAll(); this.albumService.DeleteAlbum(albumId); return(this.RedirectToAction("ListAll")); }
public IActionResult Delete(int id, DeleteAlbumViewModel model) { var singer = _albumAppService.GetAlbumById(id); model = new DeleteAlbumViewModel() { Id = singer.Id, Name = singer.Name }; return(PartialView("_Delete", model)); }
public ActionResult Delete(Guid id) { var response = _albumService.GetAlbum(new GetAlbumRequest { Id = id }); var model = new DeleteAlbumViewModel { Album = response.Album }; return(View(model)); }
public IActionResult Delete(DeleteAlbumViewModel model) { _albumAppService.Delete(model.Id); return(Json(new JsonResultEntity() { Message = "删除成功", JsonObject = Json(new AlbumViewModel() { Id = model.Id }) })); }
public IActionResult OnGet(int?albumId) { if (albumId == null) { return(NotFound()); } var album = _context.Albums.Include(x => x.Artist).SingleOrDefault(x => x.AlbumId == albumId); if (album == null) { return(NotFound()); } Album = new DeleteAlbumViewModel() { Id = album.AlbumId, Title = album.Title, Artist = album.Artist.Name, ReferenceNumber = album.ReferenceNumber }; return(Page()); }