public async Task <IActionResult> Create([Bind("Id,Naziv,Cijena")] Jelo jelo) { if (ModelState.IsValid) { _context.Add(jelo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(jelo)); }
public async Task <IActionResult> Create([Bind("Id,JeloId,Količina")] Košarica košarica) { if (ModelState.IsValid) { _context.Add(košarica); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["JeloId"] = new SelectList(_context.Jelo, "Id", "Naziv", košarica.JeloId); return(View(košarica)); }