public void Update(Color entity)
 {
     using (RentACarContext context = new RentACarContext())
     {
         var updatedColor = context.Entry(entity);
         updatedColor.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
 public void Delete(Color entity)
 {
     using (RentACarContext context = new RentACarContext())
     {
         var deletedColor = context.Entry(entity);
         deletedColor.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
 public void Add(Color entity)
 {
     using (RentACarContext context = new RentACarContext())
     {
         var addedColor = context.Entry(entity);
         addedColor.State = EntityState.Added;
         context.SaveChanges();
     }
 }
Example #4
0
 public void Update(Brand entity)
 {
     using (RentACarContext rentACarContext = new RentACarContext())
     {
         var updateEntity = rentACarContext.Entry(entity);
         updateEntity.State = EntityState.Modified;
         rentACarContext.SaveChanges();
     }
 }
Example #5
0
 public void Delete(Brand entity)
 {
     using (RentACarContext rentACarContext = new RentACarContext())
     {
         var deleteEntity = rentACarContext.Entry(entity);
         deleteEntity.State = EntityState.Deleted;
         rentACarContext.SaveChanges();
     }
 }
Example #6
0
 public void Add(Brand entity)
 {
     using (RentACarContext rentACarContext = new RentACarContext())
     {
         var addedEntity = rentACarContext.Entry(entity);
         addedEntity.State = EntityState.Added;
         rentACarContext.SaveChanges();
     }
 }