/// <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();
     }
 }
示例#3
0
 /// <summary>
 /// Persist the product 
 /// </summary>
 /// <param name="product"></param>
 public void Create(ProductEntity product)
 {
     this._productRepository.Create(product);
 }
示例#4
0
 public void Create(ProductEntity product)
 {
     this._productLogic.Create(product);
 }