C
C#2y ago
null

❔ [.NET 6][Odata 8] IQueryable Async

Hello, I am currently trying to implement an OData Web API. OData works incredibly well with IQueryable as it applies the ODataQueryOptions directly to the database call. I am trying to figure out, if it is possible to make the controller action async. What I already have implemented: [EnableQuery] [HttpGet("Users")] public IActionResult GetUsers([FromServices] UsersDbContext usersContext) { return new OkObjectResult(usersContext.Users); } What I am trying to achieve: [EnableQuery] [HttpGet("Users")] public async Task<IActionResult> GetUsers([FromServices] UsersDbContext usersContext) { return new OkObjectResult(await usersContext.Users); <--- something async }
2 Replies
Anton
Anton2y ago
there's no point to async unless you use await
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server