So I tried it again, but get the error in VS on the lambda saying "Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type". Is it because of the use of 'dynamic'?
How to display the items by sortId in Razor?
I have a list of items displayed at 'creation' id likte this:
But I would like to display them by there 'sortId'
I can't get this work. The 'soloutions' I found are based on nodes. How do I sort/order a list of items?
Hi Robbie,
I think you should be able to do something like:
This is just a guess though so let me know how you get on.
Thanks
Ben
Hi Ben,
I also thought that it wil do the trick.
So I tried it again, but get the error in VS on the lambda saying "Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type".
Is it because of the use of 'dynamic'?
Ok, not ideal but the problem is because dynamic isn't IEnumerable, try something like:
Basically you have to create a list of all your items which you can then use lambda expressions on.
Ben
Had the same problem. Solved it by abandoning razor. No time for that. Sadly - thats why xslt still will be around for a long time to come :-)
is working on a reply...