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