- 补充 IUpdate.Set(a => a.Click == 10),简化 Set 更新单个字段表达式;

This commit is contained in:
28810
2019-05-20 16:54:11 +08:00
parent 8336cf96ca
commit 98d120120b
6 changed files with 34 additions and 0 deletions

View File

@ -341,6 +341,10 @@ namespace FreeSql.Internal.CommonProvider {
return this;
}
public IUpdate<T1> Set<TMember>(Expression<Func<T1, TMember>> binaryExpression) {
if (binaryExpression?.Body.NodeType == ExpressionType.Equal) {
_set.Append(", ").Append(_commonExpression.ExpressionWhereLambdaNoneForeignObject(null, _table, null, binaryExpression, null));
return this;
}
if (binaryExpression?.Body is BinaryExpression == false &&
binaryExpression?.Body.NodeType != ExpressionType.Call) return this;
var cols = new List<SelectColumnInfo>();