-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for defining query in query types #3932
Comments
Another idea: var q = context.OrderLines
.Where(l => l.OrderId == orderId)
.IncludeFromSql(l => l.Product, "SELECT Id, UPPER(Name) AS Name FROM Products" );
|
@natemcmaster We just compose an outer query around the user query and add the join there. FromSQL already supports this. So, then, the only gotcha is making sure that the custom SQL has all of the required columns. |
@anpete oh duh. Of course we've solved this already. |
Updated the original issue to cover scenarios that could use LINQ rather then SQL. |
@divega We are more narrowly adding ToQuery for Query Types in 2.1. Do you want to keep this issue for the wider feature? |
@anpete If I understand correctly what is left, then yes. |
@anpete can you please create a separate issue can mark as resolved for 2.1 so it shows up in release notes? Then feel free to update and cross reference. |
@divega Separate from the Query Types issue? ToQuery is not stand-alone but part of the QTs feature. |
This is done for query types. Moving to the backlog for entity types. |
Bring this back to triage to discuss that the current implementation of query types is missing some of the functionality we wanted to have and discussed in #9290, even for query types:
|
Fix for #11803 actually regressed this in 2.2. It was working correctly in 2.1 RTM |
@smitpatel file an issue for the bug and fix in 2.2. |
1 similar comment
@smitpatel file an issue for the bug and fix in 2.2. |
Filed #13346 |
Filed #13358 for defining query feature on entity types. Closing this as fixed in 2.1 for query types. |
The idea is to support customizing the source query for a specific set at the model level, e.g.:
Or using LINQ and some extra state such as the DbContext
One possible advantage of having this in the model is that we would take it into account even if the entity type is included in the query as part of a navigation, e.g. it would make it possible to add additional filters on navigation properties even if they are populated using
Include()
.The text was updated successfully, but these errors were encountered: