-
Notifications
You must be signed in to change notification settings - Fork 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
Update keyless entity types topic #1736
Conversation
- Serving as the return type for ad hoc `FromSql()` queries. | ||
- Mapping to database views. | ||
- Serving as the return type for `FromSql()` queries. | ||
- Mapping to database views that do not contain a primary key. | ||
- Mapping to tables that do not have a primary key defined. | ||
- Mapping to queries defined in the model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last one is unclear. Probably should just omit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we have a page on defining queries we can add a link here:
- Mapping to queries defined in the model. | |
- Mapping to defining queries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is clearer, we can add it when there's a page on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments. Looking good.
- Are mapped on the _DbContext_ through properties of type `DbQuery<T>` rather than `DbSet<T>` | ||
- Are mapped to database objects using the `ToView` method, rather than `ToTable`. | ||
- May be mapped to a _defining query_ - A defining query is a secondary query declared in the model that acts a data source for a query type. | ||
- Entities cannot contain navigation properties to keyless entity types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Entities cannot contain navigation properties to keyless entity types. | |
- Regular entities cannot contain navigation properties to keyless entity types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keyless entity types can't contain navigation properties to keyless entity types either.
- Serving as the return type for ad hoc `FromSql()` queries. | ||
- Mapping to database views. | ||
- Serving as the return type for `FromSql()` queries. | ||
- Mapping to database views that do not contain a primary key. | ||
- Mapping to tables that do not have a primary key defined. | ||
- Mapping to queries defined in the model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we have a page on defining queries we can add a link here:
- Mapping to queries defined in the model. | |
- Mapping to defining queries. |
@AndriySvyryd we should also update the scaffolding doc:
|
764ee25
to
7a8d500
Compare
@@ -76,7 +76,7 @@ An EF Core model can now include query types. Unlike entity types, query types d | |||
- Mapping to queries defined in the model | |||
- Serving as the return type for `FromSql()` queries | |||
|
|||
Read the [section on query types](xref:core/modeling/query-types) for more information about this topic. | |||
Read the [section on query types](xref:core/modeling/keyless-entity-types) for more information about this topic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is keeping link title as query types here intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in 2.1 they were query types
@@ -416,7 +416,7 @@ This change is introduced in EF Core 3.0-preview 3. | |||
|
|||
**Old behavior** | |||
|
|||
Before EF Core 3.0, [query types](xref:core/modeling/query-types) were a means to query data that doesn't define a primary key in a structured way. | |||
Before EF Core 3.0, [query types](xref:core/modeling/keyless-entity-types) were a means to query data that doesn't define a primary key in a structured way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
7a8d500
to
75d9b06
Compare
Fixes #1314