I have a working application in ASP.NET Web API 2 (not Core). The app includes several datetime
columns in the database (DateTime
in C#). Until now I've been using OData 5.9 in the app and I've been able to use filter those columns in $filter
with ISO 8601 date strings. I used the suggestion in this question to add config.SetTimeZoneInfo(TimeZoneInfo.Utc);
to my config and this worked great.
Fast forward to today. I just upgraded the project to OData 7.4. Everything went smoothly except for the DateTime
properties. I can no longer use those properties in my $filter
without getting this error
Microsoft.Data.SqlClient.SqlException: Conversion failed when converting date and/or time from character string.
Is there some new configuration change I need to make to continue working with DateTime
properties in OData 7.4?