LINQ “.Include” orderby in subquery

后端 未结 3 1616
天命终不由人
天命终不由人 2021-01-12 07:33

I have the following entity code, which returns all users and \"includes\" all of their sample requests:

    var userQuery = from u in _IntranetContext.UserS         


        
3条回答
  •  情话喂你
    2021-01-12 08:12

    Edit: Treed by <15 seconds.

    var userQuery = from u in _IntranetContext.UserSet.Include("SampleRequests")
                    orderby u.LastName ascending, u.SampleRequestId descending
                    select u;
    

提交回复
热议问题