For instance i have a TermSet with the following iems "Beaches", "Cities"
I am trying to filter TaxonomyFieldValueCollection using LINQ with Exist() method to see if the returned collection has items based on TaxonomyFieldValueCollection.
var thingsToDo = from feature in HomePageFeatures where feature.ItineraryTags.Exists(HasBeaches) select feature;
privatestaticbool HasBeaches(TaxonomyFieldValue s) {if (s.Label=="Beaches") {returntrue; }else {returnfalse; } }
Drawback of this is that i have to predefine a string ( s.Label=="Beaches" ) in order for this to work.
Is there a better way to use Exist, where i can specify a string?