/// <summary> /// Persist a product /// </summary> /// <param name="product"></param> public void Create(ProductEntity product) { using (EFContext context = new EFContext()) { context.Products.Add(product); context.SaveChanges(); } }
/// <summary> /// Update stock and state from a product /// </summary> /// <param name="product"></param> public void Update(ProductEntity product) { using (EFContext context = new EFContext()) { context.Products.Attach(product); context.Entry(product).State = EntityState.Modified; context.SaveChanges(); } }
/// <summary> /// Persist the product /// </summary> /// <param name="product"></param> public void Create(ProductEntity product) { this._productRepository.Create(product); }
public void Create(ProductEntity product) { this._productLogic.Create(product); }