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