public async Task <IActionResult> Edit(int id, [Bind("ID,Nazov")] SoupKind soupKind) { if (id != soupKind.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(soupKind); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SoupKindExists(soupKind.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(soupKind)); }
public async Task <IActionResult> Create([Bind("ID,Nazov")] SoupKind soupKind) { if (ModelState.IsValid) { _context.Add(soupKind); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(soupKind)); }