Skip to content

Commit c7810d5

Browse files
claudiamurialdogenexusbot
authored andcommitted
Cherry pick branch 'genexuslabs:npgsql-upgrade' into beta
1 parent fb972d8 commit c7810d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dotnet/src/dotnetframework/GxClasses/Data/GXDataPostgreSQL.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,9 @@ public override string ConcatOp(int pos)
585585
sealed internal class PostgresqlConnectionWrapper : GxAbstractConnectionWrapper
586586
{
587587
static readonly IGXLogger log = GXLoggerFactory.GetLogger<PostgresqlConnectionWrapper>();
588+
#if NETCORE
589+
const string INFINITY_CONVERSIONS = "Npgsql.DisableDateTimeInfinityConversions";
590+
#endif
588591
public PostgresqlConnectionWrapper()
589592
{
590593
_connection = (IDbConnection)ClassLoader.CreateInstance(GxPostgreSql.NpgsqlAssembly, "Npgsql.NpgsqlConnection");
@@ -595,6 +598,9 @@ public PostgresqlConnectionWrapper(String connectionString, GxConnectionCache co
595598
try
596599
{
597600
_connection = (IDbConnection)ClassLoader.CreateInstance(GxPostgreSql.NpgsqlAssembly, "Npgsql.NpgsqlConnection", new object[] { connectionString });
601+
#if NETCORE
602+
AppContext.SetSwitch(INFINITY_CONVERSIONS, true);
603+
#endif
598604
m_isolationLevel = isolationLevel;
599605
m_connectionCache = connCache;
600606
}

0 commit comments

Comments
 (0)