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