public ICollection <ProductType> GetMenu(Guid storeId) { var productTypes = _productTypeRepository.GetByStoreId(storeId).ToList(); var result = new List <ProductType>(); foreach (var item in productTypes) { item.Products = _productRepository.GetByProductType(item.Id); if (item.Products.Count() > 0) { result.Add(item); } } return(result); }
public IEnumerable <ProductType> GetProductTypes(Guid storeId) { return(_productTypeRepository.GetByStoreId(storeId)); }