public async Task <IActionResult> Edit(int id, [Bind("Id,SwallowSoupId")] SwallowSoup swallowSoup, int grainselect) { swallowSoup.SwallowSoupId = grainselect; if (id != swallowSoup.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(swallowSoup); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SwallowSoupExists(swallowSoup.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(swallowSoup)); }
public async Task <IActionResult> Create([Bind("Id,SwallowSoupId")] SwallowSoup swallowSoup, int grainselect) { swallowSoup.SwallowSoupId = grainselect; if (ModelState.IsValid) { _context.Add(swallowSoup); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(swallowSoup)); }