提供程序影响的更改Provider-impacting changes

此页包含的链接指向在 EF Core 存储库上发出的请求,这些请求可能需要其他数据库提供程序的作者做出反应。This page contains links to pull requests made on the EF Core repo that may require authors of other database providers to react. 目的是在将提供程序更新为新版本时,为现有的第三方数据库提供程序的作者提供一个起点。The intention is to provide a starting point for authors of existing third-party database providers when updating their provider to a new version.

我们正在从2.1 到2.2 的更改启动此日志。We are starting this log with changes from 2.1 to 2.2. 在2.1 之前,我们 providers-beware providers-fyi 在问题和拉取请求上使用了和标签。Prior to 2.1 we used the providers-beware and providers-fyi labels on our issues and pull requests.

2.2---> 3。x2.2 ---> 3.x

请注意,许多 应用程序级别的重大更改 还会影响提供程序。Note that many of the application-level breaking changes will also impact providers.

  • https://github.com/aspnet/EntityFrameworkCore/pull/14022
    • 删除了过时的 Api 和折叠的可选参数重载Removed obsolete APIs and collapsed optional parameter overloads
    • 已删除 DatabaseColumn. GetUnderlyingStoreType ( # A1Removed DatabaseColumn.GetUnderlyingStoreType()
  • https://github.com/aspnet/EntityFrameworkCore/pull/14589
    • 删除过时的 ApiRemoved obsolete APIs
  • https://github.com/aspnet/EntityFrameworkCore/pull/15044
    • 由于在基实现中修复几个 bug 所需的行为更改,CharTypeMapping 的子类可能已中断。Subclasses of CharTypeMapping may have been broken due to behavior changes required to fixing a couple bugs in the base implementation.
  • https://github.com/aspnet/EntityFrameworkCore/pull/15090
    • 添加了 IDatabaseModelFactory 的基类,并将其更新为使用参数对象来缓解将来的中断。Added a base class for IDatabaseModelFactory and updated it to use a paramater object to mitigate future breaks.
  • https://github.com/aspnet/EntityFrameworkCore/pull/15123
    • 在 MigrationsSqlGenerator 中使用的参数对象可缓解未来的中断。Used parameter objects in MigrationsSqlGenerator to mitigate future breaks.
  • https://github.com/aspnet/EntityFrameworkCore/pull/14972
    • 日志级别的显式配置需要对提供程序可能使用的 Api 进行一些更改。Explicit configuration of log levels required some changes to APIs that providers may be using. 具体而言,如果提供程序直接使用日志记录基础结构,此更改可能会破坏使用。Specifically, if providers are using the logging infrastructure directly, then this change may break that use. 此外,使用基础结构 (的提供程序将需要从或派生公开) LoggingDefinitions RelationalLoggingDefinitionsAlso, Providers that use the infrastructure (which will be public) going forward will need to derive from LoggingDefinitions or RelationalLoggingDefinitions. 有关示例,请参阅 SQL Server 和内存中提供程序。See the SQL Server and in-memory providers for examples.
  • https://github.com/aspnet/EntityFrameworkCore/pull/15091
    • 核心、关系和抽象资源字符串现在是公共的。Core, Relational, and Abstractions resource strings are now public.
    • CoreLoggerExtensionsRelationalLoggerExtensions 现在是公共的。CoreLoggerExtensions and RelationalLoggerExtensions are now public. 当记录在核心或关系级别定义的事件时,提供程序应使用这些 Api。Providers should use these APIs when logging events that are defined at the core or relational level. 不要直接访问日志记录资源;这些都是内部的。Do not access logging resources directly; these are still internal.
    • IRawSqlCommandBuilder 已从单一服务更改为范围服务IRawSqlCommandBuilder has changed from a singleton service to a scoped service
    • IMigrationsSqlGenerator 已从单一服务更改为范围服务IMigrationsSqlGenerator has changed from a singleton service to a scoped service
  • https://github.com/aspnet/EntityFrameworkCore/pull/14706
    • 构建关系命令的基础结构已成为公共的,以便提供程序可以安全地使用它,并对其进行略微重构。The infrastructure for building relational commands has been made public so it can be safely used by providers and refactored slightly.
  • https://github.com/aspnet/EntityFrameworkCore/pull/14733
    • ILazyLoader 已从作用域服务更改为暂时性服务ILazyLoader has changed from a scoped service to a transient service
  • https://github.com/aspnet/EntityFrameworkCore/pull/14610
    • IUpdateSqlGenerator 已从作用域服务更改为单一服务IUpdateSqlGenerator has changed from a scoped service to a singleton service
    • 此外,已被 ISingletonUpdateSqlGenerator 删除Also, ISingletonUpdateSqlGenerator has been removed
  • https://github.com/aspnet/EntityFrameworkCore/pull/15067
    • 提供商现在使用的大量内部代码已公开A lot of internal code that was being used by providers has now been made public
    • 它不应再 necssary 引用 IndentedStringBuilder ,因为它已从公开它的位置被分解It should no longer be necssary to reference IndentedStringBuilder since it has been factored out of the places that exposed it
    • 的用法 NonCapturingLazyInitializerLazyInitializer 从 BCL 替换为Usages of NonCapturingLazyInitializer should be replaced with LazyInitializer from the BCL
  • https://github.com/aspnet/EntityFrameworkCore/pull/14608
    • 应用程序重大更改文档完全涵盖了此更改。This change is fully covered in the application breaking changes document. 对于提供程序,这可能会产生更大的影响,因为测试 EF core 常常会导致此问题,因此测试基础结构发生了变化以降低可能性。For providers, this may be more impacting because testing EF core can often result in hitting this issue, so test infrastructure has changed to make that less likely.
  • https://github.com/aspnet/EntityFrameworkCore/issues/13961
    • EntityMaterializerSource 已简化EntityMaterializerSource has been simplified
  • https://github.com/aspnet/EntityFrameworkCore/pull/14895
    • StartsWith 翻译以提供商可能需要/需要反应的方式进行了更改StartsWith translation has changed in a way that providers may want/need to react
  • https://github.com/aspnet/EntityFrameworkCore/pull/15168
    • 约定集服务已更改。Convention set services have changed. 提供程序现在应继承自 "ProviderConventionSet" 或 "RelationalConventionSet"。Providers should now inherit from either "ProviderConventionSet" or "RelationalConventionSet".
    • 自定义项可以通过 IConventionSetCustomizer 服务添加,但这种方法旨在供其他扩展使用,而不是由提供程序使用。Customizations can be added through IConventionSetCustomizer services, but this is intended to be used by other extensions, not providers.
    • 应从解析运行时使用的约定 IConventionSetBuilderConventions used at runtime should be resolved from IConventionSetBuilder.
  • https://github.com/aspnet/EntityFrameworkCore/pull/15288
    • 数据种子已重构为公共 API,以避免需要使用内部类型。Data seeding has been refactored into a public API to avoid the need to use internal types. 这只会影响非关系提供程序,因为种子设定由所有关系提供程序的基本关系类处理。This should only impact non-relational providers, since seeding is handled by the base relational class for all relational providers.

2.1---> 2。22.1 ---> 2.2

仅限测试更改Test-only changes

测试和产品代码更改Test and product code changes