zoukankan      html  css  js  c++  java
  • linq里面似in的查询

    1.linq里面似in的查询  

    List<string> source = new List<string>{ "aaa", "bbb" };        

    List<string> px = new  List<string> { "aaa", "bbb", "ccc" }; 

     var q = from s in source   

            from p in px                  

             where s==p        

              select s;

    2. 得到集合里面是  p.DState in (1, 100,200 )的集合

      List<int> pp = new  List<int> { 1, 100,200 };        

         if (queryString == "AllState")           

        {            

         DataSouce = new ObservableCollection<DocRegister>((from p in _returnList           

                      from ids in pp            

                     where p.DState == ids                

                    select p).ToList());                 

       }

    3.根据一个条件过滤数据集合queryString是条件

     DataSouce = new ObservableCollection<DocRegister>(_returnList.Where(p => p.DState == Convert.ToInt32(queryString)).ToList());

  • 相关阅读:
    PHP引用传值
    PHP快速排序
    PHP冒泡排序法
    Jquery EasyUI datagrid后台数据表格生成及分页详解
    polymer 测试
    imooc movie
    test markdown
    MEAN 27
    MEAN 26
    nodejs 负载均衡
  • 原文地址:https://www.cnblogs.com/Alex80/p/5476084.html
Copyright © 2011-2022 走看看