상속: IActivatable, IOrderable, INamedEntity, IUrlNamed
예제 #1
0
    	public static Category DefaultCategory(Category parent, int position)
    	{
			return new Category 
			{
                Parent = parent,
				Position = position
			};
    	}
예제 #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);
 }
예제 #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;
		}
예제 #4
0
 public virtual void AddCategory(Category category)
 {
     var productCategory = new ProductCategory {Category = category, Product = this};
     ProductCategories.Add(productCategory);
     category.ProductCategories.Add(productCategory);
 }
예제 #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);
 }
예제 #6
0
 partial void DeleteCategory(Category instance);
예제 #7
0
 partial void UpdateCategory(Category instance);
예제 #8
0
 partial void InsertCategory(Category instance);
예제 #9
0
		private void detach_Categories(Category entity)
		{
			this.SendPropertyChanging();
			entity.Category1 = null;
		}
예제 #10
0
		private void attach_Categories(Category entity)
		{
			this.SendPropertyChanging();
			entity.Category1 = this;
		}