Update custom db

This commit is contained in:
sunkaixuan
2025-04-23 17:27:11 +08:00
parent 1e5e8d7e7c
commit 3aaa44291e

View File

@@ -263,6 +263,14 @@ namespace SqlSugar
+ "Updateable`1";
var type = GetCustomTypeByClass<T>(name);
if (type == null)
{
name =
InstanceFactory.CustomNamespace +
"." + InstanceFactory.CustomDbName
+ "Updateable`1";
type = GetCustomTypeByClass<T>(name);
}
if (type == null)
{
return new UpdateableProvider<T>();
}
@@ -291,6 +299,14 @@ namespace SqlSugar
+ "Deleteable`1";
var type = GetCustomTypeByClass<T>(name);
if (type == null)
{
name =
InstanceFactory.CustomNamespace +
"." + InstanceFactory.CustomDbName
+ "Deleteable`1";
type = GetCustomTypeByClass<T>(name);
}
if (type == null)
{
return new DeleteableProvider<T>();
}
@@ -330,6 +346,14 @@ namespace SqlSugar
"." + currentConnectionConfig.DbType
+ "Insertable`1";
var type = GetCustomTypeByClass<T>(name);
if (type == null)
{
name =
InstanceFactory.CustomNamespace +
"." + InstanceFactory.CustomDbName
+ "Insertable`1";
type = GetCustomTypeByClass<T>(name);
}
if (type == null)
{
return new InsertableProvider<T>();
@@ -347,19 +371,7 @@ namespace SqlSugar
private static bool IsCustomDb(ConnectionConfig currentConnectionConfig)
{
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;
return currentConnectionConfig.DbType==DbType.Custom;
}
public static IDbBind GetDbBind(ConnectionConfig currentConnectionConfig)