views:

9

answers:

0

I have the following linq query

from o in context.Opportunities
                  join i in context.Interactions on o.OpportunityID equals i.OpportunityID into ints
                  from i in ints.DefaultIfEmpty()
                  orderby i.StatusID descending, o.StatusID descending
                  select o

Now i want to then do a distinct on the opportunities table but doing so removes my orderby. I know that you can do Distinct().OrderBy but how do i get a reference to the interactions table that was joined when I'm only selecting the opportunity entity?