Skip to content
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

Merged
merged 1 commit into from
Sep 18, 2019
Merged

Update keyless entity types topic #1736

merged 1 commit into from
Sep 18, 2019

Conversation

AndriySvyryd
Copy link
Member

Fixes #1314

entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
- 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.
Copy link
Member

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.

Copy link
Contributor

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:

Suggested change
- Mapping to queries defined in the model.
- Mapping to defining queries.

Copy link
Member Author

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

entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
samples/core/QueryTypes/QueryTypes.csproj Show resolved Hide resolved
Copy link
Contributor

@divega divega left a 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.

entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Entities cannot contain navigation properties to keyless entity types.
- Regular entities cannot contain navigation properties to keyless entity types.

Copy link
Member Author

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.

entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
- 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.
Copy link
Contributor

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:

Suggested change
- Mapping to queries defined in the model.
- Mapping to defining queries.

entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
samples/core/QueryTypes/QueryTypes.csproj Outdated Show resolved Hide resolved
roji
roji previously requested changes Sep 16, 2019
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
entity-framework/core/modeling/query-types.md Outdated Show resolved Hide resolved
samples/core/QueryTypes/QueryTypes.csproj Outdated Show resolved Hide resolved
@roji
Copy link
Member

roji commented Sep 16, 2019

@AndriySvyryd we should also update the scaffolding doc:

EF Core requires every entity type to have a key. Tables, however, aren't required to specify a primary key. Tables without a primary key are currently not reverse engineered.

@@ -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.
Copy link
Member

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?

Copy link
Member Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query types: update the page to use the new API
4 participants