Accepted answer

I couldn't get around this issue in a single linq statement. My work-around for now is to run the query without my order by clauses and output a List. Then in a second statement, apply the order by clauses to that list.

var dogs = _context.Dogs.Include(d => d.Fleas).ToList();
dogs = dogs.OrderBy(d => d.groomerId.HasValue).ToList();

Related Articles