예제 #1
0
        public IActionResult Index()
        {
            var assetModel = _assets.GetAllLibraryAssets();

            var displayAssets = assetModel
                                .Select(result => new AssetIndexListingModel
            {
                Id               = result.Id,
                ImageUrl         = result.ImgUrl,
                Title            = result.Title,
                AuthorOrDirector = _assets.GetAuthorOrDirector(result.Id),
                DeweyIndex       = _assets.GetDeweyIndex(result.Id),
                NumberOfCopies   = result.NumberOfCopies,
                Type             = _assets.GetType(result.Id)
            });

            var model = new AssetIndexModel()
            {
                Assets = displayAssets
            };

            return(View(model));
        }