mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Code optimization WhereColumns
This commit is contained in:
parent
e2af0a6e1d
commit
e95dd5ed26
@ -257,11 +257,14 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else if (PrimaryKeys.HasValue())
|
else if (PrimaryKeys.HasValue())
|
||||||
{
|
{
|
||||||
foreach (var item in PrimaryKeys)
|
if (IsWhereColumns == false)
|
||||||
{
|
{
|
||||||
var isFirst = whereString == null;
|
foreach (var item in PrimaryKeys)
|
||||||
whereString += (isFirst ? " WHERE " : " AND ");
|
{
|
||||||
whereString += Builder.GetTranslationColumnName(item) + "=" + this.Context.Ado.SqlParameterKeyWord + item;
|
var isFirst = whereString == null;
|
||||||
|
whereString += (isFirst ? " WHERE " : " AND ");
|
||||||
|
whereString += Builder.GetTranslationColumnName(item) + "=" + this.Context.Ado.SqlParameterKeyWord + item;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PrimaryKeys.HasValue()&&IsWhereColumns)
|
if (PrimaryKeys.HasValue()&&IsWhereColumns)
|
||||||
|
Loading…
Reference in New Issue
Block a user