public static void EliminarPersona(int id) { using (PruEntities1 db = new PruEntities1()) { db.Persona.Remove(db.Persona.Where(i => i.Id == id).First()); db.SaveChanges(); } }
public static void EditarPersona(Persona p1) { using (PruEntities1 db = new PruEntities1()) { db.Entry(p1).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public static void AgregarPersona(Persona p1) { using (PruEntities1 db = new PruEntities1()) { db.Persona.Add(p1); db.SaveChanges(); } }