public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Director,Producer")] Kids_Collection kids_Collection) { if (id != kids_Collection.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(kids_Collection); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Kids_CollectionExists(kids_Collection.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(kids_Collection)); }
public async Task <IActionResult> Create([Bind("Id,Name,Director,Producer")] Kids_Collection kids_Collection) { if (ModelState.IsValid) { _context.Add(kids_Collection); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(kids_Collection)); }