Example #1
0
        public IActionResult GetBusinessFieldClassification(int businessFieldCategoryID, string text)
        {
            var getBusinessClassification = _organizationUnitProvider.GetBusinessFieldClassifications(businessFieldCategoryID);

            var lookUp = getBusinessClassification.Select(
                classification =>
                new
            {
                Value = classification.Id,
                Text  =
                    string.Format("{0}{1}{2}{3} - {4}", classification.MainSectionCode,
                                  classification.SectionCode, classification.SubSectionCode,
                                  classification.GroupCode, classification.GroupName)
            });

            if (!string.IsNullOrEmpty(text))
            {
                lookUp = lookUp.Where(s => s.Text.IndexOf(text, StringComparison.OrdinalIgnoreCase) >= 0);
            }
            return(Ok(lookUp));
        }