Example #1
0
        public static string GetHierachicalTaxonomy(this ITaxonomyGroup taxonomy, string stopKey, bool removeTrailingSlash = false)
        {
            if (string.IsNullOrEmpty(stopKey) || taxonomy == null)
            {
                return(string.Empty);
            }

            var taxonomyString = string.Empty;

            if (taxonomy.Terms.Count > 0)
            {
                taxonomyString = GetHierachicalTaxonomyDetail(taxonomy.Terms, stopKey);
            }
            if (removeTrailingSlash && taxonomyString.EndsWith("/"))
            {
                return(taxonomyString.Substring(0, taxonomyString.Length - 1));
            }
            return(taxonomyString);
        }
Example #2
0
 private IList <SelectListItem> GetTaxonomiesAsSelectList(ITaxonomyGroup taxonomyGroup)
 {
     return(taxonomyGroup.Terms.Select(x => new SelectListItem {
         Text = x.Name, Value = x.Codename
     }).ToList());
 }
 internal DeliveryTaxonomyResponse(ApiResponse response, ITaxonomyGroup taxonomy) : base(response)
 {
     Taxonomy = taxonomy;
 }