mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Synchronization code
This commit is contained in:
@@ -335,8 +335,11 @@ namespace SqlSugar
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
return this.EntityInfo.Columns.Where(it => {
|
return this.EntityInfo.Columns.Where(it => {
|
||||||
|
|
||||||
Check.Exception(it.IsIdentity && it.UnderType == typeof(string), "IsIdentity key can not be type of string");
|
if (StaticConfig.Check_StringIdentity)
|
||||||
|
{
|
||||||
|
Check.ExceptionEasy(it.IsIdentity && it.UnderType == typeof(string), "Auto-incremented is not a string, how can I use a executable startup configuration: StaticConfig.Check_StringIdentity=false ", "自增不是能string,如何非要用可以程序启动配置:StaticConfig.Check_StringIdentity=false");
|
||||||
|
}
|
||||||
return it.IsIdentity;
|
return it.IsIdentity;
|
||||||
|
|
||||||
}).Select(it => it.DbColumnName).ToList();
|
}).Select(it => it.DbColumnName).ToList();
|
||||||
|
@@ -1269,6 +1269,8 @@ namespace SqlSugar
|
|||||||
if (attr != null && configId != attr.configId.ObjToString())
|
if (attr != null && configId != attr.configId.ObjToString())
|
||||||
{
|
{
|
||||||
var dbName = this.Context.Root.GetConnection(attr.configId).Ado.Connection.Database;
|
var dbName = this.Context.Root.GetConnection(attr.configId).Ado.Connection.Database;
|
||||||
|
tableName = this.Context.Root.GetConnection(attr.configId).EntityMaintenance.GetEntityInfo(entity.Type).DbTableName;
|
||||||
|
oldTableName = tableName;
|
||||||
tableName = this.QueryBuilder.LambdaExpressions.DbMehtods.GetTableWithDataBase
|
tableName = this.QueryBuilder.LambdaExpressions.DbMehtods.GetTableWithDataBase
|
||||||
(this.QueryBuilder.Builder.GetTranslationColumnName(dbName), this.QueryBuilder.Builder.GetTranslationColumnName(tableName));
|
(this.QueryBuilder.Builder.GetTranslationColumnName(dbName), this.QueryBuilder.Builder.GetTranslationColumnName(tableName));
|
||||||
}
|
}
|
||||||
|
@@ -21,5 +21,7 @@ namespace SqlSugar
|
|||||||
public static Action<ISqlSugarClient> CompleteDbFunc;
|
public static Action<ISqlSugarClient> CompleteDbFunc;
|
||||||
|
|
||||||
public static Func<List<SplitTableInfo>> SplitTableGetTablesFunc;
|
public static Func<List<SplitTableInfo>> SplitTableGetTablesFunc;
|
||||||
|
|
||||||
|
public static bool Check_StringIdentity = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user