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