public IActionResult Modificar(Contactos input) { if (ModelState.IsValid) { _db.Entry(input).State = Microsoft.EntityFrameworkCore.EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(input)); }
public IActionResult Agregar(Contacto input) { if (ModelState.IsValid) { _db.Entry(input).State = Microsoft.EntityFrameworkCore.EntityState.Added; // _db.Contactos.Add (input); // _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(input)); }