Linq-多条件查询

这是一个方法,返回IList<AtAGlanceDetail>
public IList<AtAGlanceDetail> GetAtAGlanceReportByCondition(int? supplierId, string container, DateTime? ETA, string FOBPoint, string HBLNum, DateTime? motherVesselETD, string voyage) 
{ 
var data = GetAll().Where(c => c.SupplierId == supplierId && c.Container == container && c.ETA == ETA && c.FOBPoint == FOBPoint && c.HBLNum == HBLNum && c.MotherVesselETD == motherVesselETD && c.Voyage == voyage).AsQueryable(); 
return data.ToList();
}
linq的 多条件拼接 是使用
dataSouce.Where(c => c.SupplierId == supplierId(条件参数) && c.Container == container && c.ETA == ETA ) //这种格式的写法

 

posted @ 2015-01-20 11:21  dekevin  阅读(1345)  评论(0编辑  收藏  举报