public void Update(Product product) { using (var _context = new EcartContext()) { _context.Entry(product).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); } }
public void Edit(Config config) { using (var _context = new EcartContext()) { _context.Entry(config).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); } }
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(); } }