public IActionResult Detail(int id) { var asset = _assets.GetById(id); var currentHold = _checkouts.GetHolds(id).Select(a => new AssetHoldModel { HoldPlaced = _checkouts.GetCurrentHoldPlaced(a.Id).ToString("d"), PatronName = _checkouts.GetCurrentHoldPatronName(a.Id) }); var model = new AssetDetailModel { Id = id, Title = asset.Titel, Year = asset.Year, Cost = asset.Cost, Status = asset.Status.Name, ImageUrl = asset.ImageUrl, AuthorOrDirector = _assets.getAuthorOrDirector(id), CurrentLocation = _assets.GetLibraryBranch(id).Name, DeweyCallNumber = _assets.getDeweyIndex(id), ISBN = _assets.getIsbn(id), CheckoutHistories = _checkouts.GetCheckoutHistories(id), LatestCheckout = _checkouts.GetLatestCheckout(id), PatronName = _checkouts.getCurrentCheckoutPatron(id), CurrentHold = currentHold }; return(View(model)); }