Hello
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
/M
Hello
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
/M
Try OrderBy(x => x.Col1).ThenBy(x => x.Col2)
. It is a LINQ feature, anyway, not exclusive to EF.