Add Check

This commit is contained in:
sunkaixuna 2021-12-28 12:52:26 +08:00
parent bf221274ea
commit d6c96d58b8
2 changed files with 12 additions and 2 deletions

View File

@ -702,7 +702,12 @@ namespace SqlSugar
}
else
{
return this.EntityInfo.Columns.Where(it => it.IsIdentity).Select(it => it.DbColumnName).ToList();
return this.EntityInfo.Columns.Where(it => {
Check.Exception(it.IsIdentity&&it.UnderType == typeof(string), "IsIdentity key can not be type of string");
return it.IsIdentity;
}).Select(it => it.DbColumnName).ToList();
}
}
//private void TaskStart<Type>(Task<Type> result)

View File

@ -702,7 +702,12 @@ namespace SqlSugar
}
else
{
return this.EntityInfo.Columns.Where(it => it.IsIdentity).Select(it => it.DbColumnName).ToList();
return this.EntityInfo.Columns.Where(it => {
Check.Exception(it.IsIdentity&&it.UnderType == typeof(string), "IsIdentity key can not be type of string");
return it.IsIdentity;
}).Select(it => it.DbColumnName).ToList();
}
}
//private void TaskStart<Type>(Task<Type> result)