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