mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 12:18:00 +08:00
-
This commit is contained in:
parent
5689adedd4
commit
2bcee6344b
@ -1337,6 +1337,18 @@ namespace SqlSugar
|
||||
whereCol = filedEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
whereCol = filedEntity.Columns.FirstOrDefault(it => GetPrimaryKeys().Any(pk=>pk.Equals(it.DbColumnName,StringComparison.CurrentCultureIgnoreCase)) );
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
whereCol = filedEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals("id",StringComparison.CurrentCultureIgnoreCase));
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
whereCol = filedEntity.Columns.FirstOrDefault(it => (it.EntityName).Equals(it.EntityName+"id", StringComparison.CurrentCultureIgnoreCase));
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
Check.Exception(true, ".Mapper() parameter error");
|
||||
}
|
||||
@ -1381,6 +1393,18 @@ namespace SqlSugar
|
||||
whereCol = tEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
whereCol = tEntity.Columns.FirstOrDefault(it => GetPrimaryKeys().Any(pk => pk.Equals(it.DbColumnName, StringComparison.CurrentCultureIgnoreCase)));
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
whereCol = tEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals("id", StringComparison.CurrentCultureIgnoreCase));
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
whereCol = tEntity.Columns.FirstOrDefault(it => (it.EntityName).Equals(it.EntityName + "id", StringComparison.CurrentCultureIgnoreCase));
|
||||
}
|
||||
if (whereCol == null)
|
||||
{
|
||||
Check.Exception(true, ".Mapper() parameter error");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user