System.Collections.Generic.List<umbraco.MacroEngines.DynamicNode>' does not contain a definition for 'Any'
In umbraco 6.1.6 If I define a node like this:
var searchResults =Library.NodeById(1052);
Then later declare a DynamicNode to add additional nodes to the search results like this:
List<DynamicNode> newSearchResults = new List<DynamicNode>();
newSearchResults.Add(somenewitem);
searchResults = newSearchResults;
At runtime I can't access any methods like Any() or Count. I see errors like this
System.Collections.Generic.List<umbraco.MacroEngines.DynamicNode>' does not contain a definition for 'Any'
When I initially define a variable like this: var searchResults =Library.NodeById(1052); what type is it initialized as AND how would I create this strictly and use it instead of DynamicNode?
System.Collections.Generic.List<umbraco.MacroEngines.DynamicNode>' does not contain a definition for 'Any'
In umbraco 6.1.6 If I define a node like this:
Then later declare a DynamicNode to add additional nodes to the search results like this:
List<DynamicNode> newSearchResults = new List<DynamicNode>(); newSearchResults.Add(somenewitem); searchResults = newSearchResults;
At runtime I can't access any methods like Any() or Count. I see errors like this
System.Collections.Generic.List<umbraco.MacroEngines.DynamicNode>' does not contain a definition for 'Any'
When I initially define a variable like this: var searchResults = Library.NodeById(1052); what type is it initialized as AND how would I create this strictly and use it instead of DynamicNode?
Please advise it's driving me insane! Thanks!
Hi
Any() is System.Linq extention so you need have reference to System.Core and System.Linq
code works for me:
Thanks! Previously I was defining my empty node list as this:
But after hours of hair pulling just ended up finally defining it as this (which I am asuming is the implicit way the umbraco does it)
is working on a reply...