DateTime in filter expression

A Query object can also take a filter expression, e.g.:

"f => f.IsActive = true"

How can I use DateTime value in the filter expression? Like:

"f => f.LastModified < \"2025-05-13T00:00:00.0000000+02:00\""

The above expression gives an error. Since the filter expression is a string, I cannot use normal datetime objects and have to cast them to string.

You can pass the DateTime in FilterParameters and refer it in the expression using @0. Similar code can be found here: Query() Result holds old data

You can also use DateTime.Parse like this:

"f => f.LastModified < DateTime.Parse(\"2025-05-13T00:00:00.0000000+02:00\")"

Cool! Thanks @korchev and @enchev !