This is caused by either:
- Property not marked as nullable (? after Type in property declaration)
- Existing record being flushed that contains an invalid null value for datetime.
This blog is a record of some development issues I have faced. There may be something of use!