public IActionResult GetFormattedBreadCrumb(CategoryMaster category, IList <CategoryMaster> allCategories = null, string separator = ">>", int languageId = 0) { string result = string.Empty; IList <CategoryMaster> breadcrumb = _categoryServices.GetCategoryBreadCrumb(category, allCategories, true); for (int i = 0; i <= breadcrumb.Count - 1; i++) { CategoryMaster categoryName = breadcrumb[i]; result = string.IsNullOrEmpty(result) ? categoryName : $"{result} {separator} {categoryName}"; //result + separator + categoryName; } return(Ok(result)); }