WebApi Internal Server Error
<p>I have 2 projects, a Front-End (AngularJS) and a Back-End (C# Web-Api). The thing is, when the front-end query the api (e.g GET localhost/api/Especialistas?rol=XXXX) I get a 500 error. Here is the code of the API: </p>

<pre><code>public IHttpActionResult GetEspecialista(string rol)
{
    Especialista especialista = db.Especialistas.First( e=&gt; e.Rol == rol);
    if (especialista == null)
    {
        return NotFound();
    }
    return Ok(especialista);
}
</code></pre>

<p>The API is working, since I reach the <code>return Ok(especialista)</code>. </p>

<p>The Front-end is using this <code>Restangular</code> to query the API</p>

<pre><code>Restangular.one("Especialistas?rol=XXXX").get()
</code></pre>

<p>The Network console shows a request <code>200 OK OPTION</code>, but a <code>500 Internal Server Error GET</code>. </p>

<p>I tried a message handler in the WebApiConfig.cs file to check if the GET request was reaching the Api, and is indeed reaching it, so I don't know what happened, since I didn't change any configuration file. </p>

<p>Any clue on how to fix this problem will be appreciated, thanks.</p>