-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CsvReader (using CSV Data Binder) does not appear to respect DateOnlyFormat or Culture options #177
Comments
Looks like there is a bug in the Sylvan.Data binder when dealing with the new DateOnly/TimeOnly types. I've got a fix for that ready, and will push it shortly as 0.2.9. However, there will also be a modification that needs to be made to your code. The issue is that the CsvDataReader doesn't "know" that any of the columns are a specific type. There are two ways to fix this. One option is to specifically tell the CsvDataReader the types of the columns, by providing a "schema". Here is some test code demonstrating how to define the schema:
The other option is to tell the databinder to use the type of the property being bound to identify the types of the columns in the source data. The
I'll post an update when the package is published. |
Okay, 0.2.9 has been published. It might take a few minutes to show up on nuget. |
Many thanks for the reply, that makes perfect sense |
No matter what I do, I can't get a CsvReader instance to parse a DateOnly in the format "dd/MM/yyyy".
Here's a minimal example to reproduce the issue which can be pasted into LINQPad. I'm using Sylvan.Data 0.2.8 and Sylvan.Data.Csv 1.2.4:
The text was updated successfully, but these errors were encountered: