Example #1
0
        public async Task <List <int> > GetCategoryId(string productId)
        {
            List <int> eventCategoryIds       = new List <int>();
            var        tiqetProductTagMapping = _tiqetProductTagMappingRepository.GetByProductId(productId).Where(s => s.IsCategoryType).ToList();

            if (tiqetProductTagMapping != null && tiqetProductTagMapping.Count() > 0)
            {
                foreach (var id in tiqetProductTagMapping)
                {
                    var tiqettagsMappings = _tiqetTagRepository.GetByTagId(id.TagId);
                    eventCategoryIds.Add(tiqettagsMappings.EventCategoryId);
                }
            }
            else
            {
                // IF we do not get catgories from api then add it to the default cat.
                eventCategoryIds.Add(TiqetsConstant.DefaultEventCategoryId);
            }

            return(eventCategoryIds);
        }