I'm trying to get a collection of items (products) where they contain a specific Category tag.
The code I have is;
IEnumerable getProducts = null;
var categories = ""; var productTags = ""; var recordOrder = 1;
// Assumes only one tag will be found as specified to Editors - ToDo: Tidy up validation here String[] categoryTags = Model.Content.GetPropertyValue("propCategoryTag").Split(',');
What query can I use in a Where clause to match a Umbraco tag to a given string value in the above example?
In the above code productCategoryTag = the tag datatype on the product which identifies it's parent category, and categories = the tag of the category I'm trying to match against.
Your help is appreciated, and also a pointer to the best reference to learn more about these LINQ queries (are they also know as Lambda expressions?) and how to use them with Umbraco i.e. like a reference to umbraco specific methods, properties, etc.
I sorted this one out myself by going back to basics and breaking the steps down, ultimately realising that all I was doing was finding a partial string inside a larger string. Duhh.
Get products matching a specific tag, using typed methodology
Hi folks,
I'm trying to get a collection of items (products) where they contain a specific Category tag.
The code I have is;
So where I'm stuck is here;
What query can I use in a Where clause to match a Umbraco tag to a given string value in the above example?
In the above code productCategoryTag = the tag datatype on the product which identifies it's parent category, and categories = the tag of the category I'm trying to match against.
Your help is appreciated, and also a pointer to the best reference to learn more about these LINQ queries (are they also know as Lambda expressions?) and how to use them with Umbraco i.e. like a reference to umbraco specific methods, properties, etc.
Thanks,
Jeremy
I sorted this one out myself by going back to basics and breaking the steps down, ultimately realising that all I was doing was finding a partial string inside a larger string. Duhh.
So the statement in question simply became;
Woot, now onto the next bug :P
is working on a reply...