public async Task <IActionResult> Leiunurk() { var leiunurkItems = await _leiunurk.GetAllItems(); var itemsListing = leiunurkItems.Select(result => new LeiunurkIndexListingModel { Id = result.Id, Name = result.Name, Description = result.Description, Price = result.Price, Images = result.Images.Select(imgresult => new ItemImages { ImageFileName = imgresult.ImageFileName }) }); var model = new LeiunurkIndexModel() { LeiunurkItemsViewList = itemsListing }; return(View(model)); }
// GET: Admin/Leiunurk public async Task <IActionResult> Index() { return(View(await _leiunurk.GetAllItems())); }