更新时间:2023-11-30 10:35:58
您好lax4u;
Hi lax4u;
此查询仅通过在末尾使用SingleOrDefault方法返回一条记录,因此无需排序,或者我遗漏了什么。
This query only returns one record by the use of the SingleOrDefault method on the end so there is nothing to sort, or am I missing something.
return repository.GetQuery()
.Where(x => x.CustomerID == customerID)
.Include(x => x.Orders.Select(y => y.OrderDetails))
.Include(x => x.Orders.Select(y => y.Payments))
.SingleOrDefault();