Conversation
…n support Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
…valuation endpoints Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
…meters Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
…encyInjection Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #621 +/- ##
==========================================
+ Coverage 89.89% 90.25% +0.35%
==========================================
Files 77 79 +2
Lines 3168 3284 +116
Branches 364 384 +20
==========================================
+ Hits 2848 2964 +116
Misses 251 251
Partials 69 69 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…penFeature.DependencyInjection Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
- Document AddMultiProvider extension methods - Explain MultiProviderBuilder usage patterns - Show examples for adding providers via factory, instance, and DI - Document evaluation strategy configuration - Add domain-scoped provider configuration examples - Position DI setup as recommended approach Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds dependency injection (DI) support for the MultiProvider in the OpenFeature .NET SDK, enabling streamlined configuration of multiple feature flag providers through a fluent builder API.
Key Changes:
- Introduced
MultiProviderBuilderclass with fluent API for adding providers (by instance, factory, or type) and configuring evaluation strategies - Added
FeatureBuilderExtensionsclass withAddMultiProviderextension methods for registering MultiProvider via DI inOpenFeatureBuilder - Updated ASP.NET Core sample to demonstrate DI-based MultiProvider configuration with multiple providers and evaluation strategy
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/OpenFeature.Providers.MultiProvider/DependencyInjection/FeatureBuilderExtensions.cs |
Adds extension methods for configuring MultiProvider with OpenFeatureBuilder, supporting both default and domain-scoped registration |
src/OpenFeature.Providers.MultiProvider/DependencyInjection/MultiProviderBuilder.cs |
Implements fluent builder API for adding providers and configuring evaluation strategies with full DI support |
test/OpenFeature.Providers.MultiProvider.Tests/DependencyInjection/MultiProviderDependencyInjectionTests.cs |
Provides comprehensive unit tests for DI integration including null validation, provider registration, and domain support |
test/OpenFeature.Providers.MultiProvider.Tests/DependencyInjection/MultiProviderBuilderTests.cs |
Tests MultiProviderBuilder functionality including method chaining, provider addition, and strategy configuration |
src/OpenFeature.Providers.MultiProvider/README.md |
Documents DI-based setup with examples for adding providers, configuring strategies, and using named domains |
samples/AspNetCore/Program.cs |
Demonstrates DI-based MultiProvider configuration with multiple providers and FirstMatchStrategy |
src/OpenFeature.Providers.MultiProvider/OpenFeature.Providers.MultiProvider.csproj |
Adds project reference to OpenFeature.Hosting for DI support |
test/OpenFeature.AotCompatibility/OpenFeature.AotCompatibility.csproj |
Updates project reference from OpenFeature.DependencyInjection to OpenFeature.Hosting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
arttonoyan
approved these changes
Nov 10, 2025
This was referenced Apr 3, 2026
Closed
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: André Silva 2493377+askpt@users.noreply.github.com
This PR
This pull request introduces dependency injection (DI) support for the MultiProvider in the OpenFeature .NET SDK, making it easier to configure and compose multiple feature flag providers using DI patterns. The main changes add new extension methods and builder classes to facilitate this integration, update sample usage, and provide comprehensive unit tests for the new functionality.
Dependency Injection Support for MultiProvider:
FeatureBuilderExtensionsclass withAddMultiProviderextension methods, enabling the registration and configuration of MultiProvider via DI inOpenFeatureBuilder. This allows for flexible, code-based configuration of multiple providers and evaluation strategies.MultiProviderBuilderclass, which provides a fluent API for adding providers (by instance, factory, or type) and setting evaluation strategies, all with DI support.Sample and Usage Updates:
Program.cs) to demonstrate the new DI-based MultiProvider configuration, including adding multiple providers, setting an evaluation strategy, and exposing an endpoint to test flag evaluation. [1] [2] [3]Testing and Project References:
MultiProviderBuilder, covering method chaining, provider addition, strategy configuration, and validation scenarios.OpenFeature.Hostingwhere necessary to support the new DI functionality. [1] [2]Related Issues
Fixes #549