That should work fine - it should order the entities with a false
foo value first, then those with a true
foo value.
That certainly works in LINQ to Objects - which LINQ provider are you actually using?
Here's a LINQ to Objects example which does work:
using System;
using System.Linq;
public static class Test
{
public static void Main()
{
var data = new[]
{
new { x = false, y = "hello" },
new { x = true, y = "abc" },
new { x = false, y = "def" },
new { x = true, y = "world" }
};
var query = from d in data
orderby d.x, d.y
select d;
foreach (var result in query)
{
Console.WriteLine(result);
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…