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