自己造轮子是一件苦差事。 现在,您可以专注于业务开发,仅需集成 ⭐️Furion⭐️ 即可。
Skip to main content

5. LinqExpression 静态类

5.1 创建一个表达式

var expression = LinqExpression.Create<T>(u => u.Id == 1);var expression2 = LinqExpression.Create<T>((u,i) => u.Id == 1 && i > 0);

5.2 拼接两个表达式

// 创建一个初始化的表达式var expression = LinqExpression.And();var expression2 = LinqExpression.IndexAnd();var expression3 = LinqExpression.Or();var expression4 = LinqExpression.IndexOr();// 拼接表达式var expression5 = expression.And(expression2);var expression6 = expression.AndIf(age > 18, expression2);var expression7 = expression.Or(expression2);var expression8 = expression.OrIf(age > 18, expression2);// 获取表达式属性名var properyName = expression.GetExpressionPropertyName(u => u.Name);    // Name
演练场