public virtual void AddProduct(Product product) { var productCategory = new ProductCategory {Category = this, Product = product}; product.ProductCategories.Add(productCategory); ProductCategories.Add(productCategory); }
public virtual void AddCategory(Category category) { var productCategory = new ProductCategory {Category = category, Product = this}; ProductCategories.Add(productCategory); category.ProductCategories.Add(productCategory); }
public virtual void AddCategory(Category category, int position) { var productCategory = new ProductCategory { Category = category, Product = this, Position = position }; ProductCategories.Add(productCategory); category.ProductCategories.Add(productCategory); }
partial void DeleteProductCategory(ProductCategory instance);
partial void UpdateProductCategory(ProductCategory instance);
partial void InsertProductCategory(ProductCategory instance);
private void detach_ProductCategories(ProductCategory entity) { this.SendPropertyChanging(); entity.Product = null; }
private void attach_ProductCategories(ProductCategory entity) { this.SendPropertyChanging(); entity.Category = this; }