Example app for paramters object#598
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new console sample that demonstrates using FeatureFilterConfiguration.ParametersObject to supply strongly-typed filter settings directly from a custom IFeatureDefinitionProvider, avoiding IConfiguration-based parameter binding.
Changes:
- Introduces
ParameterObjectConsoleAppexample project with a top-levelProgram.csthat evaluates a targeting-based feature for multiple users. - Adds an
InMemoryFeatureDefinitionProviderthat returns aFeatureDefinitionwhose filter settings are provided viaParametersObject. - Documents the concept and usage in a new sample
README.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| examples/ParameterObjectConsoleApp/README.md | Documents the new ParametersObject-based sample and how to run it. |
| examples/ParameterObjectConsoleApp/Program.cs | Implements the sample’s runtime evaluation loop using ContextualTargetingFilter. |
| examples/ParameterObjectConsoleApp/ParameterObjectConsoleApp.csproj | Defines the new .NET 8 console app project and references the main library. |
| examples/ParameterObjectConsoleApp/InMemoryFeatureDefinitionProvider.cs | Provides in-memory feature definitions using ParametersObject for targeting settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| await Task.CompletedTask; |
There was a problem hiding this comment.
GetAllFeatureDefinitionsAsync is implemented as an async iterator but only awaits Task.CompletedTask at the end, which is redundant and adds noise. Consider removing the trailing await (and/or dropping async if you switch to a non-async implementation) so the method is a straightforward async iterator.
| await Task.CompletedTask; |
31f525f to
537ccaa
Compare
No description provided.