public IActionResult Detail(int id) { var asset = _asset.GetById(id); var currentHolds = _checkOuts.GetCurrentHolds(id) .Select(a => new AssetHolds { HoldPlaced = _checkOuts.GetCurrentHoldPlaced(a.Id).ToString("d"), PatronName = _checkOuts.GetCurrentHoldPatronName(a.Id) }); var model = new AssetDetailModel { AssetId = id, Tittle = asset.Title, Type = _asset.GetType(id), Year = asset.Year, Cost = asset.Cost, Status = asset.Status.Name, ImageUrl = asset.ImageUrl, AuthrOrDirector = _asset.GetAuthorOrDirector(id), CurrentLocation = _asset.GetCurrentLocation(id).Name, DeweyCallNumber = _asset.GetDeweyIndex(id), CheckOutHistory = _checkOuts.GetCheckOutHistory(id), ISBN = _asset.GetIsbn(id), LatestCheckout = _checkOuts.GetLatestCheckOuts(id), PatronName = _checkOuts.GetCurrentCheckoutPatron(id), CurrentHolds = currentHolds }; return(View(model)); }