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