这两个查询有什么区别?它们不是一样的吗?哪一个更快?在where之后再加where会有问题吗?对我来说,在where之后再加where会更容易阅读我的代码。我做错了吗?
第一个查询:
第二个查询:
第一个查询:
Model= (model.Where(p => p.Date.Year == yilim)
.Where(p => p.Id== 2 || p.Id== 3)
.OrderBy(m => m.Date.Month))
.ToList();
第二个查询:
Model= (model.Where(p => p.Date.Year == yilim && (p.Id== 2 || p.Id== 3))
.OrderBy(m => m.Date.Month))
.ToList();