Ejemplo n.º 1
0
        public IActionResult ListVideo()
        {
            var assetModels   = _videos.GetAll();
            var ListingResult = assetModels
                                .Select(result => new VideoIndexListingModel
            {
                Id               = result.Id,
                ImageURL         = result.ImageUrl,
                AuthorOrDirector = _videos.GetAuthorOrDirector(result.Id),
                Title            = result.Title,
                NumberOfCopies   = result.NumberOfCopies.ToString(),
                Year             = result.Year.ToString(),
                Status           = result.Status.ToString(),
                Cost             = result.Cost.ToString(),
                Location         = _asset.GetCurrentLocation(result.Id)?.Name.ToString()
            });
            var model = new VideoIndexModel()
            {
                Videos = ListingResult
            };

            return(View(model));
            // return Content(mess);
        }