Does anyone know how to return an ordered list of strings with null values last? I have something like this:
using(var context = new DomainEntities())
{
var result = context.Users.OrderBy(u => u.LastName).ThenBy(u => u.FirstName);
}
My problem though is that this query returns null values before non-null values.
Any thoughts?
I would do:
…which should produce reasonable SQL.
EDIT: explanation (taken from Craig’s comment):
Because
falsesorts beforetrue.