Document Cosmos discriminator naming breaking change (EF Core 11) - #5391
Merged
cincuranet merged 5 commits intoJun 24, 2026
Conversation
Copilot created this pull request from a session on behalf of
AndriySvyryd
June 24, 2026 01:32
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Documents an EF Core 11 Cosmos DB breaking change where the discriminator’s model property name is Discriminator again while the JSON property name remains $type by default, clarifying that stored documents are unaffected.
Changes:
- Adds a new low-impact breaking change entry describing the discriminator model-name vs JSON-name decoupling and mitigations.
- Updates Cosmos modeling docs with an EF Core 11 note and documents the model-wide
HasEmbeddedDiscriminatorNameAPI.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md | Adds a new EF Core 11 breaking-change section and summary-table row explaining the Cosmos discriminator naming change and mitigations. |
| entity-framework/core/providers/cosmos/modeling.md | Adds a note clarifying model vs JSON discriminator naming and points readers to the EF Core 11 breaking change entry. |
cincuranet
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the EF Core 11 breaking change from efcore#38458: the default Azure Cosmos DB discriminator property is now named
Discriminatorin the EF model again, while the property written to the JSON document remains$typeby default. The model name and JSON name are now decoupled, so stored documents are unaffected.Changes
ef-core-11.0/breaking-changes.md— New low-impact entry (summary-table row + section):$typeused as both the model property name and the JSON name; an invalid C# identifier that produced uncompilable code for compiled models / precompiled queries (Native AOT).Discriminator; JSON name stays$type. On-disk format unchanged.$type; set the JSON name model-wide viaHasEmbeddedDiscriminatorName; per-entity viaToJsonProperty; or restore the old model name withHasDiscriminator<string>("$type").Discriminator.providers/cosmos/modeling.md— Note clarifying model name vs JSON name and documenting the previously undocumented model-wideHasEmbeddedDiscriminatorNameAPI, including an example that aligns the JSON discriminator name with the model property name.Setting the JSON name to match the model name