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