You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is my first time using AutoMapper with OData, I have a test EFCore API enabled with all the odata features with the following URL: https://localhost:<port>/odata/patients
SELECT p."Id",
p."FirstName",
p."MiddleName",
p."LastName",
p."Age",
p."Gender",
p."PhoneNumber", (e."Id" IS NULL), e."Id",
e."Data",
a."AppointmentType",
a."Date",
a."Id",
t0."Id",
t0."TreatmentType",
t0."TotalCost",
t0."PaymentType",
t0."PaymentStatus",
t0."Id0",
t0."Value",
n."Id",
n."Value"FROM"Patients"AS p
LEFT JOIN"ExtraDatas"AS e ON p."ExtraDataId"= e."Id"LEFT JOIN"Appointments"AS a ON p."Id"= a."PatientId"LEFT JOIN
(SELECT t."Id",
t."TreatmentType",
t."TotalCost",
t."PaymentType",
t."PaymentStatus",
p0."Id"AS"Id0",
p0."Value",
t."PatientId"FROM"Treatments"AS t
LEFT JOIN"Payments"AS p0 ON t."Id"= p0."TreatmentId") AS t0 ON p."Id"= t0."PatientId"LEFT JOIN"Notes"AS n ON p."Id"= n."PatientId"ORDER BY p."Id",
e."Id",
a."Id",
t0."Id",
t0."Id0"
while a regular odata action with EnableQuery with the same URL:
The default behavior will expand all of your navigation properties. Setting ExplicitExpansion will of course mean that a consumer of the API will now have to explicitly expand the navigation properties in order to include those entities in the result set.
Also, as a side note (unrelated to this library) you're currently executing your query synchronously.
Take a look at this issue. In order to get around that you can explicitly call ToListAsync on the IQueryable.
This is my first time using AutoMapper with OData, I have a test EFCore API enabled with all the odata features with the following URL:
https://localhost:<port>/odata/patients
Patients
:(The DTO in this situation has the exact same structure as actual DB Entity)
but using
GetQueryAsync
like this:produces this SQL:
while a regular odata action with
EnableQuery
with the same URL:Am I missing something here?
The text was updated successfully, but these errors were encountered: