views:

17

answers:

1

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

+2  A: 

Try OrderBy(x => x.Col1).ThenBy(x => x.Col2). It is a LINQ feature, anyway, not exclusive to EF.

Konamiman