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