public IActionResult Delete(int id, int?assetId) { var asset = _assets.GetById(id); _assets.Delete(asset); var assetModels = _assets.GetAll(); var listingResult = assetModels .Select(result => new AssetIndexListingModel { Id = result.Id, ImageUrl = result.ImageUrl, AuthorOrDirector = _assets.GetAuthorOrDirector(result.Id), Title = result.Title, DewyCallNumber = _assets.GetDeweyIndex(result.Id), Type = _assets.GetType(result.Id) }); var model = new AssetIndexModel() { Assets = listingResult }; return(RedirectToAction("Index", new { assetId = assetId })); }
public IActionResult Delete(int?id, Book book) { _libraryAsset.Delete(book.Id); return(RedirectToAction("AssetList")); }
public IActionResult Delete(int id) { _assets.Delete(id); return(View("./SuccessDelete")); }