You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
OK, there's a lot of moving parts here; can I clarify:
you're sending a DateTime value into the database, presumably as a typed parameter
this ends up in your database table
QUESTION: what is the exact column type?
QUESTION: for a value of 2024-03-09 (which allows for ambiguity between 9th March and 3rd September, depending on how written): what exactly gets stored in the database (so we can determine whether the delta is read vs write)?
you're then querying this value, presumably into a typed model
QUESTION: what is the property type in your model?
QUESTION: for the same test value, what value is retrieved?
I'm not aware of this consciously changing at any point, but philosophically:
IMO the library should almost always use culture invariants for storage, so: it is probably correct as described
if you're storing data like dates as strings... maybe don't do that?
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.
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: