Multiple "order by" in LINQ

meanora

New member
I have two tables, movies and categories, and I want to get an ordered list by categoryID first and then by pintodown Name.

The movie table has three columns ID, Name and CategoryID. The category table has two columns ID and Name.

I tried something like the following, but it didn't work.

var movies = _db.Movies.OrderBy( m => { m.CategoryID, m.Name })
 

Similar threads

U
Replies
0
Views
154
/u/Interesting_Bug9308
U
M
Replies
0
Views
28
Michael Tabb
M
M
Replies
0
Views
126
Maggie Koerth
M
A
Replies
0
Views
62
A FiveThirtyEight Chat
A
N
Replies
0
Views
585
Nate Silver
N
Top