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