public async Task <IActionResult> Edit(int id, [Bind("AutoId,PhoneNumber,Loc")] TableMvc2 tableMvc2) { if (id != tableMvc2.AutoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tableMvc2); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TableMvc2Exists(tableMvc2.AutoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tableMvc2)); }
public async Task <IActionResult> Create([Bind("AutoId,PhoneNumber,Loc")] TableMvc2 tableMvc2) { if (ModelState.IsValid) { _context.Add(tableMvc2); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tableMvc2)); }