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