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