Replies: 1 comment 5 replies
-
I'm particularly confused about this statement. What exactly are you trying to "find a way around of" over there? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using the latest OData v9 + EF Core nugets and am noticing some interesting T-SQL depending on how I formulate my controller. The thing I'm currently scrutinizing is efficient data querying of the fields specified by the
$select
query-string parameter.This works:
But the async version will generate T-SQL for all the fields
In both approaches, the returned JSON payload is trimmed to the desired fields.
In the 2nd approach, I'm obviously calling
.ToListAsync()
directly instead of letting the framework handle it- therein lies the problem, but I have yet to discover a way around this. So it is doing a full load of the table's rows and columns into memory before trimming it downBut I don't want to solely focus on the async pattern, as I believe I have other scenarios that cause the expected ODataQueryOptions to fail at translating the desired LINQ logic into the EF queryable
===
FWIW - this is the relevant portions of my Program.cs you might want to see
These are my Web API packages:
===
Here's an example API call that features several query string parameters, and I want to notice that only the
$select
parameter is ignored in the generated T-SQL/odata/Profiles?$select=ProfileId,WasteName,GeneratorCode&$filter=CustomerId gt 15089&$top=5
I have a controller that is formulated correctly as described above, but, is producing this result. And I don't know exactly how to go about deubgging this issue yet
Beta Was this translation helpful? Give feedback.
All reactions