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