用法

集合过滤器= new List(); QueryFilter filter = new QueryFilter(NameBurger,Operator.StartsWith); filters.Add(过滤器);

 Expression<Func<Food, bool>> query = ExpressionBuilder.GetExpression<Food>(filters);

在这种情况下,它是对 Food 实体的查询,想要查找名称中以 Burger 开头的所有食物。

输出:

query = {parm => a.parm.StartsWith("Burger")}

Expression<Func<T, bool>> GetExpression<T>(IList<QueryFilter> filters)