I'm having trouble with nullable dates. At first my model included this field:
public DateTime CompletedDateTime { get; set; }
When I changed it to...
public DateTime? CompletedDateTime { get; set; }
...and did a migration, everything seemed to work okay at first. This was only because field CompletedDateTime had a date in it. When I had a record that had a NULL in that field, any PUSH or PULL operations freeze up and the log in Azure Portal is very vague and simply says there's a 400 Bad Request because of a malformed request. It can happen if I set the NULL in my local offline table (then try a pushitemsasync) OR in Azure (then a pullitemsasync).
I did notice that EFFrameworkCore is generating a "datetime2(7) NULL" from a DateTime? in C#. I'm not sure if this has anything to do with the issue.
I'm using .NET 8, MAUI version 8.0.60, Datasync client 6.1.0 and EF Framework Core 8.0.1
datetime
data type is a legacy left over from when SQL Server was Sybase and will cause you difficulties at some point due to its 1/300th second imprecision.DateTime
, or should you be usingDateOnly
instead?