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