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