var q = from order in db.Orders
                        where  1==1  orderby order.OrderDate descending
                        select order;一个条件好搞 多条件咋搞
一般多条件查询 拼sql就ok了 
 

解决方案 »

  1.   

    你多写几个where
    应该就是多条件了吧。
      

  2.   

    首先写一个基本的查询,如
    var datas = from o in db.Orders select o;
    然后:
    datas = datss.Where(o => o.xx == 'xx');
    datas = datas.Where(c => c.xx.Contains('xx');但是这种方式吧,只适合拼接 And 的查询,对 Or 的查询拼接是没用的。
      

  3.   

    like '%abc%'  -> Contains 
    like '%abc'   -> EndWith
    like 'abc%'   -> StartWith
      

  4.   

    linq 实现查询字符串拼接 : And 和 OR 两种方式 http://blog.csdn.net/q107770540/article/details/5387946
      

  5.   

    查了些资料感觉linq把查询 简单问题复杂化了
    这还是单表 要是多表估计要写一大堆
    也许是我没理解吧 
    谁能给个多条件的例子
    最好类似 string.Format("where {0} like'%{1}%'",SearchKey,SearchValue)一行代码搞定
     
      

  6.   

    http://developer.51cto.com/art/200909/152524.htm