✅ Nullable DateTimeOffset field in a [FromForm] model is always null
I have a React Native (Expo running on Expo Go on an Android specifically) client and an ASP.NET Core Web API server.
My client sends requests with content type
But when the request reaches the server, the model's nullable
Logs in screenshot:
My client sends requests with content type
multipart/form-data, and supplies the correct values for each field. Specifically in this example, the BirthDate field is either omitted entirely from the FormData, or it's given an ISO timestamp string with Z offset. I don't send null, undefined, '' or anything like that.But when the request reaches the server, the model's nullable
BirthDate field is always null with either cases (client doesn't include the field in its FormData, OR the field's value is something like 2023-04-27T02:50:23.636Z). Other fields are still sent properly (either given a proper value, or is null once the server reads the request).Logs in screenshot:
