From 5bc23c8d0f0f42c0a7733a154a84ab837fc72bc3 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 4 May 2025 18:36:13 +0800 Subject: [PATCH] Update InstanceFactory --- .../Infrastructure/InstanceFactory.cs | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs index d214337e8..c80400bac 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace SqlSugar @@ -364,14 +365,30 @@ namespace SqlSugar } } else - { + { return new InsertableProvider(); } } private static bool IsCustomDb(ConnectionConfig currentConnectionConfig) { - return currentConnectionConfig.DbType==DbType.Custom; + if (currentConnectionConfig.DbType == DbType.Custom) + { + return true; + } + return currentConnectionConfig.DbType != DbType.SqlServer && + currentConnectionConfig.DbType != DbType.Dm && + currentConnectionConfig.DbType != DbType.Oscar && + currentConnectionConfig.DbType != DbType.Access && + currentConnectionConfig.DbType != DbType.QuestDB && + currentConnectionConfig.DbType != DbType.MySql && + currentConnectionConfig.DbType != DbType.Oracle && + currentConnectionConfig.DbType != DbType.PostgreSQL && + currentConnectionConfig.DbType != DbType.ClickHouse && + currentConnectionConfig.DbType != DbType.GBase && + currentConnectionConfig.DbType != DbType.Sqlite && + GetCustomTypeByClass("SqlSugar." + currentConnectionConfig.DbType + "." + currentConnectionConfig.DbType + "Provider") != null; + } public static IDbBind GetDbBind(ConnectionConfig currentConnectionConfig)