I am trying to filter children of the current node in my View and I was hoping to do something like below using LINQ but the code will not compile because the GetPropertyValue is unrecognised.
CS1977:
Cannot use a lambda expression as an argument to a dynamically
dispatched operation without first casting it to a delegate or
expression tree type.
I have seen a few other topics in the forum where the above works (GetProperty within a lambda). What am I missing? How would you usually filter a list of this type either in a view or in a partial view?
Filtering Children with LINQ and GetPropertyValue
Using V 6.1.6.
I am trying to filter children of the current node in my View and I was hoping to do something like below using LINQ but the code will not compile because the GetPropertyValue is unrecognised.
I get a
CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.
I have seen a few other topics in the forum where the above works (GetProperty within a lambda). What am I missing? How would you usually filter a list of this type either in a view or in a partial view?
J
Hello,
You are using CurrentPage.Id which is dynamic and that's why extension methods wont' work.
Try something like this:
Jeroen
Yep that was it.
Just added
And then used
Thanks
J
is working on a reply...