//first controllerl action public IActionResult Index() { var assetModels = _asset.GetAll(); var listingResult = assetModels .Select(result => new AssetIndexListingModel { Id = result.ID, ImageUrl = result.ImageUrl, AuthorOrDirector = _asset.getAuthorOrDirector(result.ID), DeweyCallNumber = _asset.getDeweyIndex(result.ID), Title = result.Title, Type = _asset.getType(result.ID), }); var model = new AssetIndexModel() { Asset = listingResult }; return(View(model)); }
public IActionResult Index() { var assetModels = _assets.GetAll(); var model = assetModels.Select( result => new AssetIndexModel { Id = result.Id, ImageUrl = result.ImageUrl, Title = result.Titel, NumberOfCopies = result.NumberOfCopies, AuthorOrDirector = _assets.getAuthorOrDirector(result.Id), DeweyCallNumber = _assets.getDeweyIndex(result.Id), Type = _assets.getType(result.Id) } ); return(View(model)); }