C# List查询

实体类: 

public class A
{
public string str{get;set;}
public bool bol{get;set;}
public decimal dec{get;set;}
}

查询:

List lists=new List();
A a1=new A();
a.str="a";
a.bol=false;
a.dec=1;
lists.Add(a1);

var querylist=lists.Where(x=>x.bol==false).ToList();

 

你可能感兴趣的:(c#,List查询)