public HiLToysDataModel.Category GetCategoryInformation(string categoryName) { HiLToysDataModel.Category category = new HiLToysDataModel.Category(); category = storeDB.Categories.Single( scategory => scategory.CategoryName == categoryName); return category; }
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; }