------解决方案-------------------- .Where<T>(Predicate) 是延迟执行的,可以利用它来拼凑多个条件 ------解决方案-------------------- Expression<Func<TData, bool>> w = (data) => true;
w = (data) => w(data) && data.a == aaa; // where a = aaa
w = (data) => w(data) && data.b == bbb; // where a = aaa and b = bbb
w = (data) => w(data) ------解决方案-------------------- data.c == ccc; // where (a = aaa and b = bbb) or c = ccc
...
var query = from x in datasource where w(x); ------解决方案--------------------
var query=from a in SampleCustomTableRecords
join b in SampleCustomTableRecords
on a.RecordIndex equals b.RecordIndex
where a.FK1==73 && a.FK2==131 && b.FK1==74 && b.FK2=163
select a;
------解决方案-------------------- var query = ...
...
query = from x in query
join y in anothertable
on x.xxx equals y.yyy
select xxx;