public async Task <IActionResult> Index() { var applicationDbContext = _context.Smestaji.Include(s => s.Aranzman); CreateSmestajViewModel viewModel = new CreateSmestajViewModel { Smestajs = await applicationDbContext.ToListAsync() }; return(View(viewModel)); }
// GET: SmestajUAranzmanu public async Task <IActionResult> SmestajUaranzmanu(Guid aranzmanId) { var applicationDbContext = _context.Smestaji.Include(s => s.Aranzman).Where(a => a.AranzmanId == aranzmanId); CreateSmestajViewModel viewModel = new CreateSmestajViewModel { Smestajs = await applicationDbContext.ToListAsync(), AranzmanId = aranzmanId }; return(View("Index", viewModel)); }