public IList<ProductSubcategory> ChoicesProductSubcategory(ProductCategory productCategory) {
     if (productCategory != null) {
         return (from psc in Container.Instances<ProductSubcategory>()
             where psc.ProductCategory.ProductCategoryID == productCategory.ProductCategoryID
             select psc).ToList();
     }
     return new ProductSubcategory[] {}.ToList();
 }
 public IList<ProductSubcategory> Choices1ListProducts(ProductCategory category)
 {
     if (category != null)
     {
         return category.ProductSubcategory.ToList();
     } else
     {
         return null;
     }
 }
 /// <summary>
 /// Create a new ProductCategory object.
 /// </summary>
 /// <param name="productCategoryID">Initial value of the ProductCategoryID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="rowguid">Initial value of the rowguid property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static ProductCategory CreateProductCategory(global::System.Int32 productCategoryID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate)
 {
     ProductCategory productCategory = new ProductCategory();
     productCategory.ProductCategoryID = productCategoryID;
     productCategory.Name = name;
     productCategory.rowguid = rowguid;
     productCategory.ModifiedDate = modifiedDate;
     return productCategory;
 }
 public IQueryable<Product> ListProducts(ProductCategory category, ProductSubcategory subCategory)
 {
     return from obj in Instances<Product>()
            where obj.ProductSubcategory.ProductSubcategoryID == subCategory.ProductSubcategoryID
            orderby obj.Name
            select obj;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the ProductCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProductCategories(ProductCategory productCategory)
 {
     base.AddObject("ProductCategories", productCategory);
 }