S
shapper
Hello,
I have the following:
DateTime c = database.Posts.Max(b => b.CreatedAt).Value;
b.CreatedAt is of type "DateTime?"
The problem is when database.Posts is empty. I get an error:
Nullable object must have a value.
I understand that I get a null value but I am not able to apply ??
because it does not allow me.
How can I solve this?
Thanks,
Miguel
I have the following:
DateTime c = database.Posts.Max(b => b.CreatedAt).Value;
b.CreatedAt is of type "DateTime?"
The problem is when database.Posts is empty. I get an error:
Nullable object must have a value.
I understand that I get a null value but I am not able to apply ??
because it does not allow me.
How can I solve this?
Thanks,
Miguel