public Product Add(Product e) { UpdateCategory(e); DB.Products.AddObject(e); Save(); return e; }
public Product Update(Product e) { DB.Products.Attach(e); UpdateCategory(e); DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified); Save(); return e; }
public void UpdateCategory(Product e) { CategoryRepository catRepository = new CategoryRepository(); catRepository.Set3LevelByFullname(e.NewCategoryFullName, e.UpdateCategory); }
public void Delete(Product e) { DB.Products.DeleteObject(e); Save(); }
/// <summary> /// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToProducts(Product product) { base.AddObject("Products", product); }
/// <summary> /// Create a new Product object. /// </summary> /// <param name="id">Initial value of the ID property.</param> public static Product CreateProduct(global::System.Int32 id) { Product product = new Product(); product.ID = id; return product; }