Update samples to .NET 11 preview 7 - #5456
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates this repo’s C# sample suite to align with .NET 11 preview 7 / EF Core 11 preview 7, keeping code + docs snippets in sync so the samples continue to build and the documentation reflects the same API surface.
Changes:
- Retargets most samples to
net11.0and updates EF Core / ASP.NET Core package references to11.0.0-preview.7.26381.103. - Updates compiled-model sample code to include required
RuntimeModelconstructor metadata for EF Core 11. - Synchronizes the “bulk configuration” docs snippet with the corresponding sample code change.
Reviewed changes
Copilot reviewed 98 out of 98 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/global.json | Pin samples SDK to .NET 11 preview 7. |
| samples/end2end/PlanetaryDocs/Tests/DomainTests/DomainTests.csproj | Retarget tests to net11.0. |
| samples/end2end/PlanetaryDocs/PlanetaryDocsLoader/PlanetaryDocsLoader.csproj | Retarget to net11.0 and use C# 11. |
| samples/end2end/PlanetaryDocs/PlanetaryDocs/PlanetaryDocs.csproj | Retarget app to net11.0. |
| samples/end2end/PlanetaryDocs/PlanetaryDocs.Domain/PlanetaryDocs.Domain.csproj | Retarget to net11.0 and use C# 11. |
| samples/end2end/PlanetaryDocs/PlanetaryDocs.DataAccess/PlanetaryDocs.DataAccess.csproj | Retarget to net11.0 and bump EF Core Cosmos package. |
| samples/end2end/PlanetaryDocs/Directory.Build.props | Set solution-wide C# language version to 11. |
| samples/core/Testing/TestingWithTheDatabase/TestingWithTheDatabase.csproj | Retarget to net11.0. |
| samples/core/Testing/TestingWithoutTheDatabase/TestingWithoutTheDatabase.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Testing/BusinessLogic/BusinessLogic.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Testing/BloggingWebApi/BloggingWebApi.csproj | Retarget to net11.0. |
| samples/core/SqlServer/SqlServer.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Sqlite/ValueGeneration/SqliteValueGeneration.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Spatial/SqlServer/SqlServer.csproj | Retarget to net11.0 and bump provider packages. |
| samples/core/Spatial/Projections/Projections.csproj | Retarget to net11.0. |
| samples/core/Schemas/TwoProjectMigrations/WorkerService1/WorkerService1.csproj | Retarget to net11.0 and bump EF Core packages/tools. |
| samples/core/Schemas/TwoProjectMigrations/SqlServerMigrations/SqlServerMigrations.csproj | Retarget to net11.0. |
| samples/core/Schemas/TwoProjectMigrations/SqliteMigrations/SqliteMigrations.csproj | Retarget to net11.0. |
| samples/core/Schemas/ThreeProjectMigrations/WebApplication1/WebApplication1.csproj | Retarget to net11.0 and bump ASP.NET Core/EF packages. |
| samples/core/Schemas/ThreeProjectMigrations/WebApplication1.Migrations/WebApplication1.Migrations.csproj | Retarget to net11.0 and bump EF Core design/provider packages. |
| samples/core/Schemas/ThreeProjectMigrations/WebApplication1.Data/WebApplication1.Data.csproj | Retarget to net11.0 and bump ASP.NET Core Identity/EF packages. |
| samples/core/Schemas/Migrations/Migrations.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Schemas/MigrationBundle/MigrationBundle.csproj | Retarget to net11.0 and bump EF Core design/provider packages. |
| samples/core/Saving/Saving.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Querying/UserDefinedFunctionMapping/UserDefinedFunctionMapping.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Querying/Tracking/Tracking.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Querying/Tags/Tags.csproj | Retarget to net11.0 and bump provider package. |
| samples/core/Querying/RelatedData/RelatedData.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Querying/QueryFilters/QueryFilters.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Querying/Pagination/Pagination.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Querying/Overview/Overview.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Querying/NullSemantics/NullSemantics.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Querying/ComplexQuery/ComplexQuery.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Querying/ClientEvaluation/ClientEvaluation.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Performance/Other/Other.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Performance/AspNetContextPoolingWithState/AspNetContextPoolingWithState.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Performance/AspNetContextPooling/AspNetContextPooling.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Modeling/ValueConversions/ValueConversions.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Modeling/TableSplitting/TableSplitting.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Modeling/ShadowAndIndexerProperties/ShadowAndIndexerProperties.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/Sequences/Sequences.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/Relationships/Relationships.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Modeling/OwnedEntities/OwnedEntities.csproj | Retarget to net11.0 and bump EF Core design/provider packages. |
| samples/core/Modeling/Misc/Misc.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/Keys/Keys.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/KeylessEntityTypes/KeylessEntityTypes.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/Inheritance/Inheritance.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/IndexesAndConstraints/IndexesAndConstraints.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/GeneratedProperties/GeneratedProperties.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/EntityTypes/EntityTypes.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/EntityProperties/EntityProperties.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/DynamicModel/DynamicModel.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/DataSeeding/DataSeeding.csproj | Retarget to net11.0 and bump EF Core design/provider packages. |
| samples/core/Modeling/ConcurrencyTokens/ConcurrencyTokens.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Modeling/ComplexTypes/ComplexTypes.csproj | Bump EF Core preview package references. |
| samples/core/Modeling/BulkConfiguration/ModelBuildingConventionsSample.cs | Adjust type-mapping lookup API usage for EF Core 11. |
| samples/core/Modeling/BulkConfiguration/BulkConfiguration.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/SaveChangesInterception/SaveChangesInterception.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/NullableReferenceTypes/NullableReferenceTypes.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Miscellaneous/NewInEFCore9.Cosmos/NewInEFCore9.Cosmos.csproj | Retarget to net11.0. |
| samples/core/Miscellaneous/NewInEFCore7/.config/dotnet-tools.json | Pin dotnet-ef tool to preview 7. |
| samples/core/Miscellaneous/NewInEFCore6/.config/dotnet-tools.json | Pin dotnet-ef tool to preview 7. |
| samples/core/Miscellaneous/NewInEFCore6.Cosmos/.config/dotnet-tools.json | Pin dotnet-ef tool to preview 7. |
| samples/core/Miscellaneous/Multitenancy/TenantControls/TenantControls.csproj | Retarget to net11.0 and bump ASP.NET Core package. |
| samples/core/Miscellaneous/Multitenancy/SingleDbSingleTable/SingleDbSingleTable.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/Multitenancy/MultiDb/MultiDb.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/Multitenancy/Common/Common.csproj | Retarget to net11.0. |
| samples/core/Miscellaneous/Logging/SimpleLogging/SimpleLogging.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Miscellaneous/Logging/Logging/Logging.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/Events/Events.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/DiagnosticListeners/DiagnosticListeners.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/ConnectionResiliency/ConnectionResiliency.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/ConnectionInterception/ConnectionInterception.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/ConfiguringDbContext/ConfiguringDbContext.csproj | Retarget to net11.0 and bump ASP.NET Core/EF packages. |
| samples/core/Miscellaneous/CompiledModels/SingleRuntimeModel.cs | Add required RuntimeModel constructor metadata for EF Core 11. |
| samples/core/Miscellaneous/CompiledModels/MultipleRuntimeModels.cs | Add required RuntimeModel constructor metadata for EF Core 11. |
| samples/core/Miscellaneous/CompiledModels/dotnet-tools.json | Bump dotnet-ef tool to preview 7 for compiled models. |
| samples/core/Miscellaneous/CompiledModels/CompiledModels.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Miscellaneous/CommandLine/CommandLine.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Miscellaneous/CommandInterception/CommandInterception.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/Collations/Collations.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/CachingInterception/CachingInterception.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Miscellaneous/Async/Async.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Intro/Intro.csproj | Retarget to net11.0 and bump EF Core packages/tools. |
| samples/core/GetStarted/EFGetStarted.csproj | Retarget to net11.0 and bump EF Core packages/tools. |
| samples/core/DbContextPooling/DbContextPooling.csproj | Retarget to net11.0 and bump EF Core package. |
| samples/core/Cosmos/Cosmos.csproj | Retarget to net11.0 and bump EF Core Cosmos package. |
| samples/core/ChangeTracking/IdentityResolutionInEFCore/IdentityResolutionInEFCore.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/ChangeTracking/ChangingFKsAndNavigations/ChangingFKsAndNavigations.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/ChangeTracking/ChangeTrackingInEFCore/ChangeTrackingInEFCore.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/ChangeTracking/ChangeTrackerDebugging/ChangeTrackerDebugging.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/ChangeTracking/ChangeDetectionAndNotifications/ChangeDetectionAndNotifications.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/ChangeTracking/AdditionalChangeTrackingFeatures/AdditionalChangeTrackingFeatures.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/ChangeTracking/AccessingTrackedEntities/AccessingTrackedEntities.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/CascadeDeletes/CascadeDeletes.csproj | Retarget to net11.0 and bump EF Core packages. |
| samples/core/Benchmarks/Benchmarks.csproj | Retarget to net11.0 and bump EF Core packages. |
| entity-framework/core/modeling/bulk-configuration.md | Keep the documentation snippet synchronized with the updated sample code. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "tools": { | ||
| "dotnet-ef": { | ||
| "version": "10.0.0", | ||
| "version": "11.0.0-preview.7.26381.103", | ||
| "commands": [ | ||
| "dotnet-ef" | ||
| ] |
| "tools": { | ||
| "dotnet-ef": { | ||
| "version": "10.0.0", | ||
| "version": "11.0.0-preview.7.26381.103", | ||
| "commands": [ | ||
| "dotnet-ef" | ||
| ] |
| "tools": { | ||
| "dotnet-ef": { | ||
| "version": "10.0.0", | ||
| "version": "11.0.0-preview.7.26381.103", | ||
| "commands": [ | ||
| "dotnet-ef" | ||
| ] |
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 98 out of 98 changed files in this pull request and generated no new comments.
Suppressed comments (4)
Previously missed (1) — in code that hasn't changed since the last review.
samples/global.json:3
- The PR description states that the sample suite is being updated to .NET 11 and preview 7 across the board, but there are still samples in
samples/targeting older TFMs (e.g. net6.0/net7.0) and using EF Core 6/7 packages. If those are intentionally excluded, the PR description/scope should be adjusted; otherwise consider upgrading the remaining samples as well.
samples/core/Miscellaneous/NewInEFCore7/.config/dotnet-tools.json:6
- This sample targets net7.0 and references EF Core 7.0.0 packages (including Microsoft.EntityFrameworkCore.Design 7.0.0), but the local tool manifest pins dotnet-ef to 11.0.0-preview.7. dotnet-ef is generally expected to match the EF Core major version used by the project; keeping these aligned avoids version-mismatch issues when running
dotnet effor this sample.
samples/core/Miscellaneous/NewInEFCore6/.config/dotnet-tools.json:6 - This sample targets net6.0 and references EF Core 6.0.0 packages (including Microsoft.EntityFrameworkCore.Design 6.0.0), but the local tool manifest pins dotnet-ef to 11.0.0-preview.7. dotnet-ef is generally expected to match the EF Core major version used by the project; keeping these aligned avoids version-mismatch issues when running
dotnet effor this sample.
samples/core/Miscellaneous/NewInEFCore6.Cosmos/.config/dotnet-tools.json:6 - This sample targets net6.0 and uses EF Core 6.0.x (see NewInEFCore6.Cosmos.csproj), but the local tool manifest pins dotnet-ef to 11.0.0-preview.7. dotnet-ef is generally expected to match the EF Core major version used by the project; keeping these aligned avoids version-mismatch issues when running
dotnet effor this sample.
Updates the sample suite to .NET 11 using SDK and EF Core preview 7.
Runtime and dependencies
net11.0dotnet-efto preview 7EF Core 11 compatibility
PropertyInfo.PropertyType