Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicolai 48 posts 201 karma points
    Jan 26, 2017 @ 20:03
    Nicolai
    0

    At least one object must implement IComparable.

    Hey guys, I've been getting this error, occasionally, when trying to create a dynamicnodelist that has a where and orderby clause. The statement looks like this:

    top3News = Model.Descendants().Where("NodeTypeAlias == \"Arrangement\""").OrderBy("orderDate desc");
    

    But now it gets weird!.. I only get this error when the last created content node (with NodeTypeAlias Arrangement) has no value in my custom property orderDate. E.g. All other nodes does not need to have any value in orderDate but the most recent one does.

    I have been pulling my hair out of my head trying to solve this anoyingly random error.

    Can anyone shed some light on this?

    Follow up Is there anyway to only do the OrderBy if the node HasValue in orderDate ?

Please Sign in or register to post replies

Write your reply to:

Draft