Example #1
0
 public void RemoveClient_ExI_EF()
 {
     using (var ctx = new PilimEntities())
     {
         Cliente cliente = ctx.Cliente.Find("18572048");
         ctx.Cliente.Attach(cliente);
         ctx.Cliente.Remove(cliente);
         ctx.SaveChanges();
     }
 }
Example #2
0
 public void RemoveTriplo_ExercicioF_EF()
 {
     using (var ctx = new PilimEntities())
     {
         Triplos triplo = ctx.Triplos.Find("IE00BXC8D038", new DateTime(2019, 12, 26, 16, 0, 0));
         ctx.Triplos.Attach(triplo);
         ctx.Triplos.Remove(triplo);
         ctx.SaveChanges();
     }
 }