Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor to EFCore.Relational as public API#38408
Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor to EFCore.Relational as public API#38408Copilot wants to merge 8 commits into
Conversation
…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>
There was a problem hiding this comment.
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
IOperationReporterand snapshot processing abstractions/implementation intoEFCore.Relational(namespaces preserved to avoid churn). - Moved the
MultipleAnnotationConflictresource fromDesignStringstoRelationalStringsand updated usages/tests accordingly. - Updated build/test infrastructure references (linked-source path in
ef.csproj, explicitEFCore.Relationalreference 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>
There was a problem hiding this comment.
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>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
cincuranet
left a comment
There was a problem hiding this comment.
I would prefer to also change the namespace, but if not having usings churn is strongly preferred, it's fine with me.
|
@copilot Move IOperationReporter, ISnapshotModelProcessor and SnapshotModelProcessor out of the |
…Processor to public API Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Done in the latest commit. |
Relational providers reference
EFCore.Relationalbut notEFCore.Design, so they could not derive fromSnapshotModelProcessoror register a customISnapshotModelProcessorfor provider-specific snapshot fixups. This relocates those design-time services down toEFCore.Relationaland promotes them out of.Internalnamespaces as documented public API.Type moves
IOperationReporter→Microsoft.EntityFrameworkCore.Design(inEFCore.Relational/Design/)ISnapshotModelProcessor,SnapshotModelProcessor→Microsoft.EntityFrameworkCore.Migrations(inEFCore.Relational/Migrations/)OperationReporterandIOperationReportHandlerstay inEFCore.Design(Design-only concerns).Supporting changes
MultipleAnnotationConflictresource fromDesignStringstoRelationalStrings(the processor can no longer reachDesignStrings).#pragma warning disable EF1001around internalModel/ModelExtensionsusage, since the EF analyzer runs inEFCore.Relational(it does not inEFCore.Design).ef.csprojand added an explicitEFCore.Relationalreference toEFCore.Specification.Tests(which disables transitive references).EFCore.RelationalandEFCore.DesignAPI baselines to reflect the new public surface and the updatedAddEntityFrameworkDesignTimeServicesparameter type.The default registration stays a
TryAddinDesignTimeServiceCollectionExtensions, which runs after provider design-time services — so a provider override now wins: