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 }));
        }
Ejemplo n.º 2
0
 public IActionResult Delete(int?id, Book book)
 {
     _libraryAsset.Delete(book.Id);
     return(RedirectToAction("AssetList"));
 }
Ejemplo n.º 3
0
        public IActionResult Delete(int id)
        {
            _assets.Delete(id);

            return(View("./SuccessDelete"));
        }