<p>I have two tables, <code>movies</code> and <code>categories</code>, and I want to get an ordered list by <strong>categoryID</strong> first and then by <strong>Name</strong>.</p>
<p>The movie table has three columns <strong>ID, Name and CategoryID</strong>.
The category table has two columns <strong>ID and Name</strong>.</p>
<p>I tried something like the following, but it didn't work.</p>
<pre><code>var movies = _db.Movies.OrderBy( m =&gt; { m.CategoryID, m.Name })
</code></pre>

This should work for you:
```
```
var movies = _db.Movies.OrderBy(c => c.Category).ThenBy(n => n.Name)
```
```