コード例 #1
0
 public HiLToysDataModel.Category GetCategoryInformation(string categoryName)
 {
     HiLToysDataModel.Category category = new HiLToysDataModel.Category();
     category = storeDB.Categories.Single(
                scategory => scategory.CategoryName == categoryName);
     return category;
 }
コード例 #2
0
        public List<HiLToysDataModel.Product> GetCategoryProducts(string category)
        {
            HiLToysDataModel.Category rtndcategory = new HiLToysDataModel.Category();
               rtndcategory = GetCategoryInformation(category);
               List<HiLToysDataModel.Product> products = new List<HiLToysDataModel.Product>();
               products= storeDB.Products.Where(product => product.CategoryID == rtndcategory.CategoryID).ToList();

            return products;
        }