Please consider altering or providing configuration for how DateTime values are formatted in filter expressions generated by ToDataSourceRequest(). Currently, the format includes full precision (e.g., 2025-04-04T00:00:00.0000000), which causes issues when passed to Entity Framework Core with SQL Server, as SQL Server expects precision up to milliseconds (.fff), not ticks (.fffffff).
Why This Is a Problem
Hi Kenneth,
The filter expressions generated by ToDataSourceRequest() are in a List of IFilterDescriptor. The IFilterDescriptor contains the dates as DataTime objects and not as strings in the format that you listed. Having that in mind, it is currently not clear how you are getting this format and hitting an issue with it. Can you provide more details and an isolated runnable sample showing your exact configuration?
In addition, can you please test the code without using the ToDataSourceRequest() and let me know if it still fails? We generally recommend using the ToDataSourceResult(request) method so it manages the operations for you when using OnRead which is different than ToDataSourceRequest(). Can you please share what are you using the ToDataSourceRequest() for?
Last but not least, based on the information I found here, datetime2 types support nanosecond-level precision. Can you please share why are you left with the impression that they don't?
Regards,
Nadezhda Tacheva
Progress Telerik
Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!