Example #1
0
 public void Update(Product product)
 {
     using (var _context = new EcartContext())
     {
         _context.Entry(product).State = System.Data.Entity.EntityState.Modified;
         _context.SaveChanges();
     }
 }
Example #2
0
 public void Edit(Config config)
 {
     using (var _context = new EcartContext())
     {
         _context.Entry(config).State = System.Data.Entity.EntityState.Modified;
         _context.SaveChanges();
     }
 }
Example #3
0
        public void Create(Product product)
        {
            using (var _context = new EcartContext())
            {
                _context.Entry(product.Category).State = System.Data.Entity.EntityState.Unchanged;

                _context.Products.Add(product);
                _context.SaveChanges();
            }
        }