Esempio n. 1
0
        public IEnumerable <Category> getProductByCategory(int parentId)
        {
            List <Category> result = new List <Category>();

            result.Add(_businessCategory.GetById(parentId));
            var children = _businessCategory.GetAll().Where(i => i.ParentId == parentId).ToList();

            foreach (var item in children)
            {
                result.AddRange(getProductByCategory(item.Id));
            }

            return(result);
        }
Esempio n. 2
0
 public Category GetById(int id)
 {
     return(business.GetById(id));
 }