FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
152 stars 62 forks source link

FBZonedDateTime with legacy code #1177

Open PaladinMattt opened 1 week ago

PaladinMattt commented 1 week ago

We have legacy code that supports multiple database systems and had been using: DateTime dt = Convert.ChangeType(valueReturnedFromQuery, typeof(DateTime)); to get the datetime values. This works fine in our Firebird 3 systems, but in testing out migrating to Firebird 5, this throws the Exception: System.InvalidCastException: 'Object must implement IConvertible.' Is there a reason FBZonedDateTime does not implement IConvertible? It could return the DateTime in the local users time or UTC time.

This functionality could be behind an AppContext switch, much the same way Npgsql has done (Ngsql.EnableLegacyTimestampBehavior), where essentially DbDataType.TimeStampTZ is treated as DbDataType.TimeStamp

cincuranet commented 1 week ago

No particular reason. And I don't see any problem adding IConvertible implementation.

PaladinMattt commented 1 day ago

I pulled down the repo and am trying to setup my test environment to get all the tests to pass, but am having some difficulty. Some of the tests fail with: Unable to load DLL 'fbembed' or one of its dependencies: The specified module could not be found. (0x8007007E) Also, my EntityFramework tesks appear to fail, possibly because I have my test environment setup to not use the default port 3050, since I use that for other environments. Do you have a readme document or some other information that can help me get all my tests passing?