我需要根据多列筛选列表。这里是我的课,我需要寻找筛选多列的列表
public class psdata
{
public int ID { get; set; }
public string Customer { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
public decimal? Identification { get; set; }
public decimal? Assesment { get; set; }
public decimal? PayoffLedger { get; set; }
public decimal? RentRestrictions { get; set; }
public decimal? CCR { get; set; }
public decimal SubTotal { get; set; }
}
这里是我的LINQ查询,看起来我的列表,然后将找到的搜索词,如果它被包含在列。
var sl = list.Where<psdata>(c => c.Address.ToLower().Contains(text));
这对第一列非常有用。但是,如果我想添加另一列如此。
var sl = list.Where<psdata>(c => c.Address.ToLower().Contains(text) || c => c.City.ToLower().Contains(text));
我得到一个错误
Operator || cannot be applied to operands of the type bool and psdata.
什么我错在这里做什么?