This project has moved and is read-only. For the latest updates, please go here.
1

Closed

How to use <Today /> in the c# api?

description

Hello team,

How would say the following query in C#? What's the way to include <Today /> as a value for date time filter?

<Leq>
              <FieldRef Name='myStartDate' />
              <Value Type='DateTime'><Today /></Value>
           </Leq>
Closed Oct 29, 2015 at 8:50 AM by sadomovalex

comments

sadomovalex wrote Oct 29, 2015 at 8:50 AM

Hi Anton,
there are few helpers for that in the library:
string query = Camlex.Query().Where(x => x["myStartDate"] <= (DataTypes.DateTime)Camlex.Today).ToString()

avishnyakov wrote Oct 29, 2015 at 9:58 AM

Thanks! That's really cool.

sadomovalex wrote Oct 29, 2015 at 10:32 AM

np, glad to help)