Beispiel #1
0
        public void Add(Product entity)
        {
            var addedEntity = _eTradeContext.Entry(entity);

            addedEntity.State = EntityState.Added;
            _eTradeContext.SaveChanges();
        }
Beispiel #2
0
 public void Delete(Product product)
 {
     using (ETradeContext context = new ETradeContext())
     {
         var entity = context.Entry(product);
         entity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }