【发布时间】:2015-07-03 08:40:41
【问题描述】:
我想生成像这样的表达式树
StatusRAG.where(x=> (overallRAG.Contains(x.OverallRAG) == overallRAGinclusive) || (costRAG.Contains(x.CostRAG) == costRAGinclusive))
这是我的数据:
var overallRAG = new List<string>(){"Red", "Green"}
var costRAG = new List<string>(){"Red", "Amber"}
bool overallRAGinclusive = true
bool costRAGinclusive = false
class StatusRAG
{
public OverallRAG {get; set;}
public CostRAG {get; set;}
}
【问题讨论】:
-
你有什么问题?
-
我想应用动态过滤器。用户可以从 UI 中选择整体 RAG 值(红色、绿色、琥珀色),并且可能希望包含或排除这些数据。用户可以对两个 RAG 应用过滤器或仅对 1 个应用过滤器。
标签: linq expression-trees