Umbracians for Unicef - the friendly fundraising
In the spirit of holidays and humanity, we started a fundraising for Unicef. You won't believe what we could change if every visitor on Our Umbraco donated a dollar or euro. Click and find out!
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);
var listOfKeywords = keywords.Split(' ').ToList<string>();
var values = new Dictionary<string, object>();
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?
var qsFacetIngredients = (string)qsItems["ingredients"] ?? String.Empty;
var aryFacetIngredients = BaseUtility.SplitClean(qsFacetIngredients, '|');
var facetValues = new Dictionary();
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.
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
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
Just wondering what you did as a workaround because I can't get it working at all..
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:
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..
I've just patched the support for this feature in the trunk, would you like to try an updated binary?