This is a follow-up to OData AspNetCore support for long URLs useing $query is not working.
OData 8.0.4
In startup, I have app.UseODataQueryRequest()
My Controller looks like
[ODataAttributeRouting]
public class ODataQueryController : Controller
{
[HttpGet] // not needed, it turns out
[EnableQuery]
[Route("Thing")]
public IActionResult GetThings()
{
return Ok(ApplicationContext.Things);
}
}
and my POST looks like
POST http://localhost:8080/api/odata/Thing/$query
Request Body: $select=Column
Content-Type: text/plain
and I get a 404
Placing app.UseODataQueryRequest()
before app.UseRouting()
resolved this issue for me
Startup.cs:
...
app.UseODataQueryRequest();
...
app.UseRouting();
...