public async Task <IActionResult> Edit(int id, [Bind("IdType,Name,Description,Status")] TypeShoeModel typeShoeModel) { if (id != typeShoeModel.IdType) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(typeShoeModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeShoeModelExists(typeShoeModel.IdType)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(typeShoeModel)); }
public async Task <IActionResult> Create([Bind("IdType,Name,Description,Status")] TypeShoeModel typeShoeModel) { if (ModelState.IsValid) { _context.Add(typeShoeModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typeShoeModel)); }