Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Jul 25, 2011 @ 05:47
    Tom
    0

    Where Clause to detect if something is set? DateTime

    Hi Guys,

    trying to implement a where clause on a dynamicnodelist to get only the children where a property which is a datetime is set..

    i have tried:

    Model.NodeById(1191).Descendants("someDataType").Where("lastUpdated.GetType() != typeof(DynamicNull)

    or

     

    Model.NodeById(1191).Descendants("someDataType").Where("lastUpdated is DateTime")

    Model.NodeById(1191).Descendants("someDataType").Where("lastUpdated != null && lastUpdated.ToString() != \"\"")

     

    any advice?


  • James Drever 118 posts 149 karma points
    Nov 29, 2011 @ 13:07
    James Drever
    0

    Hi Tom,

    Don't suppose you, or any one else, managed to find an answer to this one.  I have exactly the same problem (or a variation - I want to include all nodes where a date time field is null)..

    Using closingDate.GetType() == typeof(DynamicNull) gives Expression of type 'System.Object' cannot be used for label of type 'System.Type'

    Using closingDate==null, or closingDate.ToString()==\"\"" returns no nodes, even when closingDate is null.

    Thanks,

    James.

Please Sign in or register to post replies

Write your reply to:

Draft