Why does HierarchicalTaxonomy contain a IList collection
...and not an IList<HierarchicalTaxon> collection?
Hi,
HierarchicalTaxonomy inherits from Taxonomy base class where the Taxa is ot type IList<Taxon>, HierarchicalTaxon have Subtaxa of type IList<HierarchicalTaxon>
Greetings,
Stanislav Velikov
the Telerik team
That's what I mean...why do we have to do some casting, can't it be more elegant than that?
TaxonomyManager manager = TaxonomyManager.GetManager();
var taxonomyParent = manager.GetTaxonomies<HierarchicalTaxonomy>().FirstOrDefault(x => x.Name == fieldName);
var taxons = taxonomyParent.Taxa.Where(x => categories.Contains(x.Id)).Select(x => (HierarchicalTaxon)x);
return
taxons.ToList();
...or whatever