我有Linq to Entity查詢,就像你可以看到下面我在我的代碼中使用它五次,所有改變的是where子句。是否有可能創建一個方法並傳遞值,而不是將所有代碼寫入五次。謝謝Linq to Entity動態where子句
items = from t1 in _entities.table1
join t2 in _entities.Table2 on t1.column1 equals t2.column1
join t3 in _entities.Table3 on t1.column2 equals t3.column2
join t4 in _entities.Table4 on t1.column3 equals t4.column3
where **t1.column5 == Something**
select new
{
t1.column7,
t2.column8,
t3.column9,
t4.column10
};
你沒有導航性能? – LukLed 2010-05-10 19:30:24