I send a keyword of 'summary', which I know is in the 2 of the 3 articles that I have. The problem is that I always get a "Sequence contains no matching element". I've replaced the ContainsAny with just Contains and added the keyword in there and it works great. Just not this.
I know that Examine would be faster, but I'd doing a lot of other filters and I still might convert it at some point, but for now, this is the direction that I'm going.
var qsFacetIngredients = (string)qsItems["ingredients"] ?? String.Empty;
var aryFacetIngredients = BaseUtility.SplitClean(qsFacetIngredients, '|');
var facetValues = new Dictionary();
facetValues.Add("keywords", aryFacetIngredients);
var cmsItems = Model.Children.Where("checkboxIngredients.ContainsAny(keywords)", facetValues);
I can't use "Contains" because the filters are dynamically created by using "Ultimate Picker" data type. Thus, I need help getting the "ContainsAny" working for multiple filtering (aka facets) of food items.
FYI, I'm new to Umbraco and I've been using Razor exclusive than XSLT.
Is it possible for you to create the bug report. It's been 2 months since I wrote the code and tested it....and don't remember any of the steps to write up an accurate bug report besides containsAny doesn't work.
Trying to use containsAny in Razor in 4.7
I'm trying to implmenent the ContainsAny feature in Razor (mentioned on http://umbraco.com/follow-us/blog-archive/2011/3/13/umbraco-razor-feature-walkthrough-part-5). Here is my code.
var listOfKeywords = keywords.Split(' ').ToList<string>();
var values = new Dictionary<string, object>();
values.Add("keywords", listOfKeywords);
listOfEvents = listOfEvents.Where("summary.ContainsAny(keywords)", values);
I send a keyword of 'summary', which I know is in the 2 of the 3 articles that I have. The problem is that I always get a "Sequence contains no matching element". I've replaced the ContainsAny with just Contains and added the keyword in there and it works great. Just not this.
I know that Examine would be faster, but I'd doing a lot of other filters and I still might convert it at some point, but for now, this is the direction that I'm going.
I'm having the same issue. Please help?
I can't use "Contains" because the filters are dynamically created by using "Ultimate Picker" data type. Thus, I need help getting the "ContainsAny" working for multiple filtering (aka facets) of food items.
FYI, I'm new to Umbraco and I've been using Razor exclusive than XSLT.
Yeah. Didn't get this to work and ending up going a different route. Good luck
If nobody can't resolve it, then it could be a bug in Umbraco 4.7.0
Chad Rosenthal,
If you think it's a bug, can you report the "ContainsAny" issue to Umbraco Issue Tracker: http://umbraco.codeplex.com/workitem/list/basic
Thank you.
Is it possible for you to create the bug report. It's been 2 months since I wrote the code and tested it....and don't remember any of the steps to write up an accurate bug report besides containsAny doesn't work.
I will investigate this issue
Hi Chad,
Just wondering what you did as a workaround because I can't get it working at all..
Cheers,
Tom
Hi Tom
I intend to investigate ContainsAny before the 4.7.1 beta is released
Could you show me what isn't working for you?
Hi Gareth! I just posted a new topic here:
http://our.umbraco.org/forum/developers/razor/22412-No-applicable-method-'ContainsAny'-exists-in-type-'String
Even if you'd be able to post the fix for just that feature I'd really appreciate it..
I just can't get it to pick up and use the extension method..
Hi Tom
I've just patched the support for this feature in the trunk, would you like to try an updated binary?
Gareth
is working on a reply...