mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 04:53:45 +08:00
Update custom db
This commit is contained in:
@@ -263,6 +263,14 @@ namespace SqlSugar
|
|||||||
+ "Updateable`1";
|
+ "Updateable`1";
|
||||||
var type = GetCustomTypeByClass<T>(name);
|
var type = GetCustomTypeByClass<T>(name);
|
||||||
if (type == null)
|
if (type == null)
|
||||||
|
{
|
||||||
|
name =
|
||||||
|
InstanceFactory.CustomNamespace +
|
||||||
|
"." + InstanceFactory.CustomDbName
|
||||||
|
+ "Updateable`1";
|
||||||
|
type = GetCustomTypeByClass<T>(name);
|
||||||
|
}
|
||||||
|
if (type == null)
|
||||||
{
|
{
|
||||||
return new UpdateableProvider<T>();
|
return new UpdateableProvider<T>();
|
||||||
}
|
}
|
||||||
@@ -291,6 +299,14 @@ namespace SqlSugar
|
|||||||
+ "Deleteable`1";
|
+ "Deleteable`1";
|
||||||
var type = GetCustomTypeByClass<T>(name);
|
var type = GetCustomTypeByClass<T>(name);
|
||||||
if (type == null)
|
if (type == null)
|
||||||
|
{
|
||||||
|
name =
|
||||||
|
InstanceFactory.CustomNamespace +
|
||||||
|
"." + InstanceFactory.CustomDbName
|
||||||
|
+ "Deleteable`1";
|
||||||
|
type = GetCustomTypeByClass<T>(name);
|
||||||
|
}
|
||||||
|
if (type == null)
|
||||||
{
|
{
|
||||||
return new DeleteableProvider<T>();
|
return new DeleteableProvider<T>();
|
||||||
}
|
}
|
||||||
@@ -331,6 +347,14 @@ namespace SqlSugar
|
|||||||
+ "Insertable`1";
|
+ "Insertable`1";
|
||||||
var type = GetCustomTypeByClass<T>(name);
|
var type = GetCustomTypeByClass<T>(name);
|
||||||
if (type == null)
|
if (type == null)
|
||||||
|
{
|
||||||
|
name =
|
||||||
|
InstanceFactory.CustomNamespace +
|
||||||
|
"." + InstanceFactory.CustomDbName
|
||||||
|
+ "Insertable`1";
|
||||||
|
type = GetCustomTypeByClass<T>(name);
|
||||||
|
}
|
||||||
|
if (type == null)
|
||||||
{
|
{
|
||||||
return new InsertableProvider<T>();
|
return new InsertableProvider<T>();
|
||||||
}
|
}
|
||||||
@@ -347,19 +371,7 @@ namespace SqlSugar
|
|||||||
|
|
||||||
private static bool IsCustomDb(ConnectionConfig currentConnectionConfig)
|
private static bool IsCustomDb(ConnectionConfig currentConnectionConfig)
|
||||||
{
|
{
|
||||||
return
|
return currentConnectionConfig.DbType==DbType.Custom;
|
||||||
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)
|
public static IDbBind GetDbBind(ConnectionConfig currentConnectionConfig)
|
||||||
|
Reference in New Issue
Block a user