From a409451314ceca2023021ba091d7e96f0b105fa3 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 11 Dec 2022 18:50:28 +0800 Subject: [PATCH] Synchronization code --- .../Realization/PostgreSQL/PostgreSQLProvider.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs index 7fbe308de..08fa743ce 100644 --- a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs +++ b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs @@ -12,7 +12,14 @@ namespace SqlSugar { public partial class PostgreSQLProvider : AdoProvider { - public PostgreSQLProvider() { } + public PostgreSQLProvider() + { + if (SugarCompatible.IsFramework == false) + { + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); + } + } public override IDbConnection Connection { get