score:3

Accepted answer

Method Syntax

var query = enumerable.OrderBy(x => x.order == null ? 1 : 0).ThenBy(x => x.order);

Query Syntax

var query = from x in enumerable
            orderby (x.order == null ? 1 : 0), x.order
            select x;

score:0

Assuming order is a nullable value (not an object), you should be able to use this:

orderby null == order ? 1 : 0, order

If it is an object, you could try

orderby null == order ? 1 : 0, order.PropertyName

Related Articles