我有以下代码
return
this.Storage.Customer.OfType<Preferred>()
.Include(b => b.Order)
.Where(cust => cust.Id == customerId && cust.CustomerType== (int)cusType)
.SingleOrDefault();
可以改写如下,去掉where。
return
this.Storage.Customer.OfType<Preferred>()
.Include(b => b.Order)
.SingleOrDefault(cust => cust.Id == customerId && cust.CustomerType == (int)cusType);
哪一个是更好的做法,为什么?