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