linq 基于var动态查询
有三表,表名A,B,C
字段
A : id name sex phone
B : id Aid Bid
C : id dept keyword
前提
var joinTable = from a in A
join b in B on b.Aid equals a.id
join c in C on b.Cid equals C.id
select new
{
aid = a.id,aname = a.name,cdept = c.dept,ckeyword = c.keyword
}
遇到的问题:
对joinTable 做动态查询怎么写 比如:对名字、性别、电话、部门、关键字 做动态查询
如:构建
ParameterExpression pe = Expression.Parameter(typeof(User), "s");
Expression left;
------解决方案--------------------
Dynamic LINQ
------解决方案--------------------http://blog.csdn.net/sandy945/article/details/5735326