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