Ejemplo n.º 1
0
 public void Delete(Car entity)
 {
     using (RentContext context = new RentContext())
     {
         var deletedContext = context.Entry(entity);
         deletedContext.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void Update(Car entity)
 {
     using (RentContext context = new RentContext())
     {
         var updatedContext = context.Entry(entity);
         updatedContext.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public void Add(Car entity)
 {
     using (RentContext context = new RentContext())
     {
         var addedContext = context.Entry(entity);
         addedContext.State = EntityState.Added;
         context.SaveChanges();
     }
 }