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

Finish What's New in EF7 #4076

Merged
merged 8 commits into from
Oct 11, 2022
Merged

Conversation

ajcvickers
Copy link
Member

No description provided.

@ajcvickers ajcvickers force-pushed the PrettyPrettyGoodButNotAsGoodAsLego1008 branch from fc5f667 to 6f89ed2 Compare October 10, 2022 19:30
@ajcvickers ajcvickers requested a review from a team October 10, 2022 19:32
entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
-->
[!code-csharp[CompositePrimaryKey](../../../../samples/core/Miscellaneous/NewInEFCore7/ModelBuildingSample.cs?name=CompositePrimaryKey)]

Defining the index on the class also means it can be used to specify private properties or fields as keys, even though these would usually be ignored when building the EF model. For example:
Copy link
Member

Choose a reason for hiding this comment

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

Huh, didn't know we didn't support [Key] on private properties/fields... Any specific reason for that?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do...but only if the member is already mapped. It won't cause it to be mapped.

Copy link
Member

Choose a reason for hiding this comment

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

Should we consider enabling this (i.e. mapping the member because it has [Key] on it)? Or would that potentially map something unwanted (because [Key] is being used for some other non-EF framework)?

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, and yes. :-D I made a note to file an issue; it's something I have been thinking about for a while, and something that Diego had ideas on.

entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md Outdated Show resolved Hide resolved
ajcvickers and others added 7 commits October 11, 2022 10:26
@ajcvickers ajcvickers merged commit 07260bf into main Oct 11, 2022
@ajcvickers ajcvickers deleted the PrettyPrettyGoodButNotAsGoodAsLego1008 branch October 11, 2022 10:51
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.

2 participants