Inheritance: IActivatable, IOrderable, INamedEntity, IUrlNamed
Ejemplo n.º 1
0
    	public static Category DefaultCategory(Category parent, int position)
    	{
			return new Category 
			{
                Parent = parent,
				Position = position
			};
    	}
Ejemplo n.º 2
0
 public virtual void RemoveCategory(Category category)
 {
     var productCategory = ProductCategories
         .Where(pc => pc.Category.Id == category.Id)
         .SingleOrDefault();
     if (productCategory == null) return;
     ProductCategories.Remove(productCategory);
 }
Ejemplo n.º 3
0
        public static Product DefaultProduct(Category parentCategory, int position)
		{
			var product = new Product 
			{
				Id = 0,
				Position = position
			};
			product.ProductCategories.Add(new ProductCategory { Category = parentCategory });
			return product;
		}
Ejemplo n.º 4
0
 public virtual void AddCategory(Category category)
 {
     var productCategory = new ProductCategory {Category = category, Product = this};
     ProductCategories.Add(productCategory);
     category.ProductCategories.Add(productCategory);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 partial void DeleteCategory(Category instance);
Ejemplo n.º 7
0
 partial void UpdateCategory(Category instance);
Ejemplo n.º 8
0
 partial void InsertCategory(Category instance);
Ejemplo n.º 9
0
		private void detach_Categories(Category entity)
		{
			this.SendPropertyChanging();
			entity.Category1 = null;
		}
Ejemplo n.º 10
0
		private void attach_Categories(Category entity)
		{
			this.SendPropertyChanging();
			entity.Category1 = this;
		}