Skip to content

#1884: Register ProcessorOptions explicitly, required by MigrationScopeHandler#1898

Merged
jzabroski merged 3 commits into
fluentmigrator:mainfrom
warappa:bugfixes/1884-resolvable-processoroptions
Oct 3, 2024
Merged

#1884: Register ProcessorOptions explicitly, required by MigrationScopeHandler#1898
jzabroski merged 3 commits into
fluentmigrator:mainfrom
warappa:bugfixes/1884-resolvable-processoroptions

Conversation

@warappa

@warappa warappa commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

Registers ProcessorOptions as a scoped service, as MigrationScopeHandler depends on it. This registration depends on the already registered IOptionsSnapshot<ProcessorOptions> via a factory method.

It's registered as scoped, because

  • MigrationScopeHandler is scoped
  • IOptionsSnapshot<> is scoped
  • IOptionsSnapshot<ProcessorOptions> is already used in MigrationRunner's constructors and passed on to MigrationScopeHandler
  • MigrationRunner is scoped

It's not registered with TryAddScoped<>(...), because resolving ProcessorOptions and IOptionsSnapshot<ProcessorOptions> should always return the same options.

Fixes #1884

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.

Unable to resolve service for type 'FluentMigrator.Runner.Processors.ProcessorOptions'

2 participants