Web API 2 Scaffolded controller's routing vs empty controller's routing
<p>As you know Visual Studio provides scaffolding for MVC and Web API controllers. In my case I'm using Entity Framework along with Web API 2. </p>

<p>When I add a new web api 2 controller with actions using Entity Framework, Visual Studio pretty much creates a controller with 5 endpoints.</p>

<p>One of these endpoints is to retrieve a single record from the database.</p>

<p>Here is an example for that:</p>

<pre><code>// GET: api/Courses/5
[ResponseType(typeof(Course))]
public async Task&lt;IHttpActionResult&gt; GetCourse(int id)
{
    Course course = await _db.Courses.FindAsync(id);
    if (course == null)
    {
        return NotFound();
    }

    return Ok(course);
}
</code></pre>

<p>The above controller works fine if I call it as api/Courses/5, but it also works fine if I call it as api/Courses?id=5.</p>

<p>My question is, if I add an empty Web API 2 controller, define these methods manually along with some other endpoints, I can either call the endpoint like the first call or the second call, but not both.</p>

<p>Is there a way to set up routing of an endpoint which would accept both options? </p>

<p>PS: I know how to separately set up routing for each of above options. My question is whether it is possible to set up for both.</p>