IQueryable<SomeType> result = (from x in Context.XXX select x);
现在我需要做的是以下(写伪代码,我需要实际的代码):如何写一个LINQ查询为此
foreach(var i in items)
{
// Where the object "i" has 2 properties
// 1) i.Operator (values of which can be AND or OR)
// 2) i.SomeID (values of which can be 1 .. 10)
// I need to build the LINQ query with "ands" and "ors" based on the i's in this foreach
}
你怎么知道每个AND和OR的范围是什么?你只是想链接它们(这可能是错误的逻辑) – 2009-09-24 12:53:18