Skip parameter binding if ParamemtersObject provided#597
Merged
zhiyuanliang-ms merged 4 commits intomainfrom Apr 23, 2026
Merged
Skip parameter binding if ParamemtersObject provided#597zhiyuanliang-ms merged 4 commits intomainfrom
zhiyuanliang-ms merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates feature filter parameter binding so that when an IFeatureDefinitionProvider supplies a typed ParametersObject, FeatureManager skips IConfiguration-based parameter binding and uses the provided object as-is.
Changes:
- Skip
IFilterParametersBinder.BindParameters(...)whenFeatureFilterEvaluationContext.ParametersObjectis already provided. - Add tests validating
ParametersObjectsupport (and invalid-type behavior) for the targeting filter.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Microsoft.FeatureManagement/FeatureManager.cs |
Avoids binding settings from IConfiguration when a provider supplies ParametersObject. |
tests/Tests.FeatureManagement/FeatureManagementTest.cs |
Adds coverage ensuring targeting respects ParametersObject and throws on invalid object type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zhiyuanliang-ms
approved these changes
Apr 22, 2026
…-Dotnet into linglingye/skip-bind-settings
CsCherrYY
approved these changes
Apr 23, 2026
zhiyuanliang-ms
added a commit
that referenced
this pull request
Apr 23, 2026
* Remove FeatureFilterEvaluationContext.ParametersObject in favor of Settings. (#599) Co-authored-by: Copilot <copilot@github.com> * Skip parameter binding if ParamemtersObject provided (#597) * Skip parameter binding if the provider has already supplied a parameters object * update * update --------- Co-authored-by: Zhiyuan Liang <zhiyuanliang@microsoft.com> --------- Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com> Co-authored-by: Copilot <copilot@github.com> Co-authored-by: linglingye001 <143174321+linglingye001@users.noreply.github.com>
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.
Why this PR?
The
BindSettingsmethod wasn't updated to skip whenParametersObjectis set — it still callsBindParameters, which fails on empty config.Visible Changes
Skip bind settings when
ParametersObjectis set.