linq - OrderBy multiple properties in Razor and Umbraco 4.11.8 -


during update of our website umbraco, upgraded 4.7.2 4.11.8.

in cshtml-file had code:

foreach(var item in model.ancestororself("master")                          .items.first()                          .publicationfolder.first()                          .children.where("visible")                          .orderby("publicationtype, date desc")) 

it worked fine , sorted collection first publicationtype , newest date.

in new version (4.11.8) doesn't work anymore. gives me exception: at least 1 object must implement icomparable.

and if write .orderby("publicationtype", "date desc"), doesn't affect collection.

so bug or doing wrong? there workaround?

i found solution need cast collection list<dynamicnode> works.

foreach (var item in ((list<dynamicnode>)@model.ancestororself("master")     .items.first()     .publicationfolder.first()     .children.where("visible").items)     .orderby(t => t.getpropertyvalue("publicationtype"))     .thenbydescending(t => t.getpropertyvalue("date"))) 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -