예제 #1
0
 public void Delete(Color entity)
 {
     using (RentalCarDbContext context = new RentalCarDbContext())
     {
         var deletedEntity = context.Entry(entity);
         deletedEntity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
예제 #2
0
 public void Update(Color entity)
 {
     using (RentalCarDbContext context = new RentalCarDbContext())
     {
         var updatedEntity = context.Entry(entity);
         updatedEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
예제 #3
0
 public void Add(Brand entity)
 {
     using (RentalCarDbContext context = new RentalCarDbContext())
     {
         var addedEntity = context.Entry(entity);
         addedEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }