-
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 mapping entity types to defining queries #13358
Comments
See also the discussion in #15239 |
Reactivating and marking as punted for 3.0 since we are disabling this again as per #17157. |
Issue #17158 contains some new data what we need to take into account when we implement this. |
@AndriySvyryd - I believe this is going to work in 5.0. How do you want to track it? |
Related to #17063 |
Note to implementor: use |
We allow mapping entity type to TVF/View/Table. When generating projection in the query, we create appropriate table source and use relevant mappings. For ad-hoc translation like FromSql, we don't have anything in model to get mappings. Additionally we are going to add ToSqlQuery which will make SQL a mix of both words (in/out of the model). Further FromSql can use any number of parameters which can change ad-hoc. For any other ad-hoc translation which are none of the above, we could also have default mappings. |
|
In EF Core 2.1 we added query types, which can be mapped in the model to "defining query" specified using the ToQuery API.
Such defining query is generally a LINQ query that becomes the source of data for read operations for the query type.
This issue is about adding the ToQuery API and the ability to map regular entity types to defining queries as well.
We need to consider that query types are read-only and so they don't need to be mapped to a table or underlying collection for the purpose of CUD operations.
Since entity types are not read-only, defining query mapping for entity types would work best in combination with custom CUD mapping, e.g. stored procedure mapping.
The text was updated successfully, but these errors were encountered: