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