Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This page documents noteworthy changes in EF Core 11 which may affect EF providers; none of these should affect end-users of EF - this page is only meant for EF provider maintainers. The list is maintained on a best-effort basis, some changes may be missing.
Changes
- Collation names are now quoted in SQL, like column and table names (see #37462). If your database doesn't support collation name quoting, override
QuerySqlGenerator.VisitSql()andMigrationsSqlGenerator.ColumnDefinition()to revert to the previous behavior, but it's recommended to implement some sort of restricted character validation. - Type mapping has been made generic to support NativeAOT (PR #38440). Provider maintainers should: (1) update custom mappings to derive from the new generic mapping base types (
CoreTypeMapping<T>andRelationalTypeMapping<T>where applicable) so default comparers can be created without reflection, and (2) update calls/overrides ofCoreTypeMapping.Clone(...)andRelationalTypeMapping.Clone(...)to remove the oldclrTypeargument. - The
JsonPathproperty onIColumnModificationandColumnModificationParametershas changed fromstring?to the new structuredJsonPathtype (PR #38038). TheJsonPathclass providesSegments,Ordinals, anIsRootproperty, and anAppendTo(StringBuilder)method for rendering the JSONPATH string. Providers that overrideUpdateSqlGenerator.AppendUpdateColumnValue()or otherwise handle JSON partial updates should update their code to use this new type. Where previously you checked fornullor"$", useJsonPath is not { IsRoot: false }instead, and callJsonPath.AppendTo(stringBuilder)to write the JSONPATH string representation. - EF Core now strips no-op SQL CASTs - i.e.
SqlUnaryExpression(Convert)nodes whose store type matches that of their operand (see #36247, PR #38156). This can flush out imprecise translations which assigned an imprecise store type to a node and then wrapped it with a Convert; because the store types now match, the Convert is stripped, and the imprecise store type may propagate. Review your translations to ensure that the operand of a Convert node has the correct, precise store type. - Keys and indexes can now traverse complex-type properties (PR #38192). The metadata API for indexes and keys has been broadened (e.g.,
FindIndex/AddIndexsignatures now acceptIReadOnlyProperty, newModelValidatorchecks, andICSharpHelperadditions). Providers that consume index/key metadata, generate C# for indexes (scaffolding/codegen), or implement custom validation should review and update their code to handle complex-type-spanning keys and indexes.
Test changes
- The inheritance specification tests have been reorganized into a folder of their own (PR).
- Query test classes now support non-shared-model tests via a new
QueryFixtureBaseclass that all query fixtures extend (PR #37681). The previous pattern of extendingSharedStoreFixtureBaseandIQueryFixtureBaseseparately has been replaced.NonSharedPrimitiveCollectionsQueryTestBasehas been merged intoPrimitiveCollectionsQueryTestBase, and per-type array tests have been moved toTypeTestBase.Primitive_collection_in_query. - EF Core's Specification.Tests assemblies have been upgraded from xUnit v2 to xUnit v3 (PR #38277). Provider test projects that reference these assemblies and inherit from the base test classes must be migrated to xUnit v3: update to the new
xunit.v3packages,Microsoft.DotNet.XUnitV3Extensions,Microsoft.Testing.Platformrunner, andMicrosoft.NET.Test.Sdk; account for[Collection]/ITestOutputHelperAPI differences; and change[ConditionalFact]to[Fact]and[ConditionalTheory]to[Theory]. When running tests directly withdotnet exec, add--filter-not-trait category=failing --ignore-exit-code 8.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.