Skip to content

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

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

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

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #37293

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.

Type moves (namespaces preserved → no using churn)

  • IOperationReporterEFCore.Relational/Design/Internal/
  • ISnapshotModelProcessor, SnapshotModelProcessorEFCore.Relational/Migrations/Internal/
  • 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).

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>
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

3 participants