Skip to content

feat(VariantBasedInjection): LazyVariantServiceProvider with Keyed DI#605

Open
Stepami wants to merge 7 commits into
microsoft:mainfrom
Stepami:feature/keyed-di
Open

feat(VariantBasedInjection): LazyVariantServiceProvider with Keyed DI#605
Stepami wants to merge 7 commits into
microsoft:mainfrom
Stepami:feature/keyed-di

Conversation

@Stepami
Copy link
Copy Markdown

@Stepami Stepami commented May 14, 2026

new class LazyVariantServiceProvider uses sp to get keyed services

Why this PR?

Keyed DI can be used in FeatureManagement library as package-provided solution despite netstandard targeting

Visible Changes

  • LazyVariantServiceProvider class
  • WithLazyVariantService di extension method

VariantServiceProvider uses sp to get keyed services

BREAKING CHANGE: behavioural: keyed services registration needed unless
we override descriptors for backward comp
@Stepami
Copy link
Copy Markdown
Author

Stepami commented May 14, 2026

@microsoft-github-policy-service agree

rename keyedServiceProvider to serviceProvider for clarity
@Stepami
Copy link
Copy Markdown
Author

Stepami commented May 15, 2026

I just thought that to avoid BC i could introduce LazyVariantServiceProvider class with keyed di as new implementation of IVariantServiceProvider. Then add WithLazyVariantService extension method. That could allow mark current implementation as obsolete to prepare consumers

Минин Степан Александрович added 4 commits May 19, 2026 15:26
Extension method impl && tests

Closes microsoft#564
Added notes about impls handling to highlight difference with lazy one
@Stepami Stepami changed the title [proof of concept] feat(VariantBasedInjection): Keyed DI PoC feat(VariantBasedInjection): Keyed DI PoC May 19, 2026
@Stepami
Copy link
Copy Markdown
Author

Stepami commented May 19, 2026

@zhiyuanliang-ms could you please take a look?

Managed to avoid BC through making Keyed DI implementation as the new feature

@Stepami Stepami changed the title feat(VariantBasedInjection): Keyed DI PoC feat(VariantBasedInjection): LazyVariantServiceProvider with Keyed DI May 19, 2026
use DI package as transitive
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.

1 participant