Closed AVee closed 3 years ago
ok that's peculiar why I didn't use the local TypesMap
instance, may have been a refactor from a static method.
Anyways, it's now fixed in this commit. This change is available from the latest v5.10.5+ that's now available on MyGet.
thx for reporting!
TL;DR:
GetDbType()
should not usePostgreSqlDialect.Instance.TypesMap
, butthis.TypesMap
. See https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/src/ServiceStack.OrmLite.PostgreSQL/PostgreSQLDialectProvider.cs#L655I subclassed PostgreSQLDialectProvider to add support for NodaTime types. Among other changes I added the NodaTime types to the TypesMap in this subclass. Elsewere in the code I was using the GetDbType() method, which I expected to now handle those types as well. However that method does it's lookup in PostgreSqlDialect.Instance.TypesMap and fails when called with the new types. If it would use this.TypesMap instead the method would work as I'd expect.