Modify verification

This commit is contained in:
sunkaixuan 2023-06-28 13:35:27 +08:00
parent 277b05cdc0
commit 743d14c8aa
2 changed files with 7 additions and 2 deletions

View File

@ -335,8 +335,11 @@ namespace SqlSugar
else
{
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;
}).Select(it => it.DbColumnName).ToList();

View File

@ -21,5 +21,7 @@ namespace SqlSugar
public static Action<ISqlSugarClient> CompleteDbFunc;
public static Func<List<SplitTableInfo>> SplitTableGetTablesFunc;
public static bool Check_StringIdentity = true;
}
}