li = warehousetocustomlist.Where(x => x.Created_By == (long)HttpContext.Current.Session["Slno"]).ToList() && warehousetocustomlist.Where(x=>x.Type==3).ToList();
在这里,我正在检查存在于同一列表中的两个条件,但是显示为:
运算符'&&'不能应用于类型为List <>和List <>的操作数。
答案 0 :(得分:1)
您将ToList放在错误的位置:
li = warehousetocustomlist
.Where(x => x.Created_By == (long)HttpContext.Current.Session["Slno"] &&
x.Type==3)
.ToList();