-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Formatting from DB Date into C# string is not using current culture (Dapper Nugget package 2.1.28) #2054
Comments
OK, there's a lot of moving parts here; can I clarify:
I'm not aware of this consciously changing at any point, but philosophically:
Happy to try to dig a bit more, but: some of this seems like a usage/database-design issue. An end-to-end example would be helpful, obviously. |
Hello, The issue happens when received value gets converted from DateTime object into C# string. var result = oracleConnection(query, parameters); class Client Yes, like I wrote before, it should be kept as C# DateTime, but its legacy. In DB its DATE type. The reading works fine. For now I reverted back to old Dapper - it formats DateTime to string taking current culture into consideration. |
ok, so the data in the database is typed as a date (whatever the relevant type is in Oracle), and is stored correctly - is that right? |
Thx for the cool ORM!
We use legacy code.
I upgraded Dapper from 2.0.30 to the Latest (Nugget package 2.1.28)
And now date is formatted to string always without respecting current culture.
With old Dapper version 2.0.30 , when change current culture to "lv-LV" and Query from Oracle, db Date field into C# string field formatted correctly "dd.mm.YYYY".
With Dapper 2.1.28 its always "mm/dd/YYYY" regardless of culture.
( Receiving Date Ok. Yeh, we should keep as C# Date, but that another story - legacy)
The text was updated successfully, but these errors were encountered: