How to compare the date returned from the database to the date (string or otherwise)?

I have a big flinq request which, by the way, returns the start date of the conversation. I would like to return only the conversations that were started after 1-1-2011.

I have something like this:

conversation.TimeOfInitiation > "1-1-2011"

but I get this error:

The type System.Nullable<System.DateTime>does not support the 'compare' constraint. For example, it does not support the "System.IComparable" interface

obvoiusly my naive approach failed. How do I get around this?

+3
source share
1 answer

http://msdn.microsoft.com/en-us/library/72cec0e0.aspx

You must get the value. Nullable is basically a generic container that carries value.

+1
source

Source: https://habr.com/ru/post/1784815/


All Articles