I need to order by 2 columns using the entity framework.
How is that done?
return _repository.GetSomething().OrderBy(x => x.Col1 .. Col2)?
i.e
SELECT * FROM Foo ORDER BY Col1, Col2
Try OrderBy(x => x.Col1).ThenBy(x => x.Col2). It is a LINQ feature, anyway, not exclusive to EF.
OrderBy(x => x.Col1).ThenBy(x => x.Col2)
Another way:
qqq.OrderBy(x => new { x.Col1, x.Col2} )