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