Copied to clipboard

Flag this post as spam?

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


  • HC Saustrup 28 posts 79 karma points
    Mar 15, 2012 @ 12:41
    HC Saustrup
    0

    Umbraco 5 - How to filter on dates with Children.Where() ?

    Hi there!

    How do I filter a list of child nodes by date using Where()? I would like to avoid nodes with a date in the future. This is my code with a non-working call to Where():

    var startNode = Umbraco.GetDynamicContentById(startNodeID);

    var nodes = startNode.Children
    .Where( ... )
    .OrderByDescending("Date");

    foreach (var node in nodes) {
    // ...
    }

    How do I do this? The statement in Where() should not break if the locale is changed.

    Thanks :-)

    Umbraco 5.0.0 RTM (Assembly version: 5.0.310.16)

     

Please Sign in or register to post replies

Write your reply to:

Draft