public void UpdateCategory(Category category) { eCommerceContext context = new eCommerceContext(); context.Entry(category).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
public void UpdateSupplier(Supplier supplier) { eCommerceContext context = new eCommerceContext(); context.Entry(supplier).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
public void UpdateConfiguration(Configuration configuration) { eCommerceContext context = new eCommerceContext(); context.Entry(configuration).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
public void UpdatePromo(Promo Promo) { eCommerceContext context = new eCommerceContext(); var exitingPromo = context.Promos.Find(Promo.ID); context.Entry(exitingPromo).CurrentValues.SetValues(Promo); context.SaveChanges(); }
public bool DeleteComment(int ID) { eCommerceContext context = new eCommerceContext(); var comment = context.Comments.Find(ID); if (comment != null) { context.Entry(comment).State = System.Data.Entity.EntityState.Deleted; } return(context.SaveChanges() > 0); }
public void UpdateConfigurationValue(string key, string value) { eCommerceContext context = new eCommerceContext(); var configuration = context.Configurations.Find(key); configuration.Value = value; context.Entry(configuration).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
public void UpdateProduct(Product Product) { eCommerceContext context = new eCommerceContext(); var exitingProduct = context.Products.Find(Product.ID); context.ProductPictures.RemoveRange(exitingProduct.ProductPictures); context.ProductSpecifications.RemoveRange(exitingProduct.ProductSpecifications); context.ProductCosts.RemoveRange(exitingProduct.ProductCosts); context.Entry(exitingProduct).CurrentValues.SetValues(Product); context.ProductPictures.AddRange(Product.ProductPictures); context.ProductSpecifications.AddRange(Product.ProductSpecifications); context.ProductCosts.AddRange(Product.ProductCosts); context.SaveChanges(); }
public void EditProduct(Product product) { _context.Entry(product).State = Microsoft.EntityFrameworkCore.EntityState.Modified; }
public void EditUpload(Upload upload) { _context.Entry(upload).State = Microsoft.EntityFrameworkCore.EntityState.Modified; }
public virtual void Update(TEntity Entity) { _context.Entry(Entity).State = EntityState.Modified; }
public void EditProductOnCart(OrderDetails orderDetails) { _context.Entry(orderDetails).State = EntityState.Modified; }