Skip to content

Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor to EFCore.Relational as public API#38408

Open
Copilot wants to merge 8 commits into
mainfrom
copilot/move-design-services-to-relational
Open

Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor to EFCore.Relational as public API#38408
Copilot wants to merge 8 commits into
mainfrom
copilot/move-design-services-to-relational

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Relational providers reference EFCore.Relational but not EFCore.Design, so they could not derive from SnapshotModelProcessor or register a custom ISnapshotModelProcessor for provider-specific snapshot fixups. This relocates those design-time services down to EFCore.Relational and promotes them out of .Internal namespaces as documented public API.

Type moves

  • IOperationReporterMicrosoft.EntityFrameworkCore.Design (in EFCore.Relational/Design/)
  • ISnapshotModelProcessor, SnapshotModelProcessorMicrosoft.EntityFrameworkCore.Migrations (in EFCore.Relational/Migrations/)
  • Each type now has proper public-API XML documentation in place of the internal-API boilerplate.
  • Concrete OperationReporter and IOperationReportHandler stay in EFCore.Design (Design-only concerns).

Supporting changes

  • Moved the MultipleAnnotationConflict resource from DesignStrings to RelationalStrings (the processor can no longer reach DesignStrings).
  • Added #pragma warning disable EF1001 around internal Model/ModelExtensions usage, since the EF analyzer runs in EFCore.Relational (it does not in EFCore.Design).
  • Updated the linked-source path in ef.csproj and added an explicit EFCore.Relational reference to EFCore.Specification.Tests (which disables transitive references).
  • Regenerated EFCore.Relational and EFCore.Design API baselines to reflect the new public surface and the updated AddEntityFrameworkDesignTimeServices parameter type.

The default registration stays a TryAdd in DesignTimeServiceCollectionExtensions, which runs after provider design-time services — so a provider override now wins:

public class MyDesignTimeServices : IDesignTimeServices
{
    public void ConfigureDesignTimeServices(IServiceCollection services)
        => services.AddScoped<ISnapshotModelProcessor, MySnapshotModelProcessor>();
}

// where MySnapshotModelProcessor : SnapshotModelProcessor (now in EFCore.Relational)

Copilot AI and others added 3 commits June 11, 2026 01:10
…sor to EFCore.Relational

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title [WIP] Move some Design services to Relational Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor to EFCore.Relational Jun 11, 2026
Copilot AI requested a review from AndriySvyryd June 11, 2026 01:16
@AndriySvyryd AndriySvyryd requested a review from Copilot June 11, 2026 02:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR relocates key design-time migration snapshot services (IOperationReporter, ISnapshotModelProcessor, SnapshotModelProcessor) into EFCore.Relational so relational providers (which commonly reference EFCore.Relational but not EFCore.Design) can derive from/override snapshot processing for provider-specific fixups.

Changes:

  • Moved IOperationReporter and snapshot processing abstractions/implementation into EFCore.Relational (namespaces preserved to avoid churn).
  • Moved the MultipleAnnotationConflict resource from DesignStrings to RelationalStrings and updated usages/tests accordingly.
  • Updated build/test infrastructure references (linked-source path in ef.csproj, explicit EFCore.Relational reference in specification tests) and updated the migrations agent skill doc.

Reviewed changes

Copilot reviewed 7 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/EFCore.Specification.Tests/EFCore.Specification.Tests.csproj Adds explicit EFCore.Relational reference needed due to non-transitive test setup.
test/EFCore.Design.Tests/Migrations/Design/SnapshotModelProcessorTest.cs Updates expected warning message source from DesignStrings to RelationalStrings.
src/EFCore.Relational/Properties/RelationalStrings.resx Adds MultipleAnnotationConflict resource to Relational.
src/EFCore.Relational/Properties/RelationalStrings.Designer.cs Adds the strongly-typed accessor for MultipleAnnotationConflict.
src/EFCore.Relational/Migrations/Internal/SnapshotModelProcessor.cs Switches warning string source to RelationalStrings and adds EF1001 suppression where needed.
src/EFCore.Relational/Migrations/Internal/ISnapshotModelProcessor.cs Introduces the snapshot processor abstraction in Relational for provider overrides.
src/EFCore.Relational/Design/Internal/IOperationReporter.cs Introduces IOperationReporter in Relational for broader provider accessibility.
src/EFCore.Design/Properties/DesignStrings.resx Removes MultipleAnnotationConflict resource from Design.
src/EFCore.Design/Properties/DesignStrings.Designer.cs Removes the strongly-typed accessor for MultipleAnnotationConflict.
src/ef/ef.csproj Updates linked-source path for IOperationReporter to point to Relational.
.agents/skills/migrations/SKILL.md Updates internal agent documentation to reflect the new locations/registration behavior.
Files not reviewed (2)
  • src/EFCore.Design/Properties/DesignStrings.Designer.cs: Language not supported
  • src/EFCore.Relational/Properties/RelationalStrings.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

src/EFCore.Relational/Migrations/Internal/SnapshotModelProcessor.cs:7

  • using Microsoft.EntityFrameworkCore.Diagnostics; is redundant here because EFCore.Relational already provides this namespace via global <Using Include="Microsoft.EntityFrameworkCore.Diagnostics" /> in EFCore.Relational.csproj. Keeping it will typically trigger IDE0005 (unnecessary using) under analyzers.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread .agents/skills/migrations/SKILL.md Outdated
@AndriySvyryd AndriySvyryd marked this pull request as ready for review June 11, 2026 02:15
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner June 11, 2026 02:15
Copilot AI review requested due to automatic review settings June 11, 2026 02:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 11 changed files in this pull request and generated no new comments.

Files not reviewed (2)
  • src/EFCore.Design/Properties/DesignStrings.Designer.cs: Language not supported
  • src/EFCore.Relational/Properties/RelationalStrings.Designer.cs: Language not supported

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Comment thread src/EFCore.Relational/Properties/RelationalStrings.Designer.cs
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 11, 2026 19:49
Copilot AI requested a review from AndriySvyryd June 11, 2026 19:49

@cincuranet cincuranet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer to also change the namespace, but if not having usings churn is strongly preferred, it's fine with me.

@AndriySvyryd

Copy link
Copy Markdown
Member

@copilot Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor out of the .Internal namespaces and document them as public API.

…Processor to public API

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 17, 2026 07:12

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor out of the .Internal namespaces and document them as public API.

Done in the latest commit. IOperationReporter is now in Microsoft.EntityFrameworkCore.Design, and ISnapshotModelProcessor/SnapshotModelProcessor are in Microsoft.EntityFrameworkCore.Migrations, with public-API XML docs. API baselines for EFCore.Relational and EFCore.Design were regenerated; all 14 EFCore.ApiBaseline.Tests pass and the 18 SnapshotModelProcessorTest tests still pass.

Copilot AI changed the title Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor to EFCore.Relational Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor to EFCore.Relational as public API Jun 17, 2026
@AndriySvyryd AndriySvyryd enabled auto-merge (squash) June 17, 2026 16:04
@AndriySvyryd AndriySvyryd requested a review from cincuranet June 17, 2026 16:52
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.

Move some of the Design services to Relational

4 participants