open-feature / open-feature/cli
feat(dotnet): leverage OpenFeature.DependencyInjection package for improved code generation
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 63
- Forks
- 22
- Avg merge
- 1h 27m
- Merged PRs (30d)
- 19
Description
Summary
Enhance the .NET code generator to leverage the latest improvements from openfeature/dotnet-sdk, specifically using OpenFeature.DependencyInjection or OpenFeature.Hosting packages to generate code that better aligns with modern .NET dependency injection patterns and the SDK's recommended practices.
Motivation
The current generated code doesn't fully embrace the DI-first philosophy of the underlying OpenFeature SDK. By utilizing the official DI packages, we can:
- Generate code that follows .NET best practices and conventions
- Provide better integration with ASP.NET Core and other .NET hosting scenarios
- Reduce boilerplate and improve developer experience
- Ensure generated code stays aligned with SDK evolution and recommendations
Proposed Solution
Update the dotnet generator to:
- Include
OpenFeature.DependencyInjectionorOpenFeature.Hostingpackage references in generated projects - Generate service registration code using
OpenFeature.DependencyInjectionorOpenFeature.Hostingwith extension methods
Related Issues
- Builds upon #208 which provides a quick-fix for DI issues using .NET Standard as a first step
- This issue represents the longer-term, more comprehensive solution
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the .NET generator and the generated project output, then review #208 and the current OpenFeature.DependencyInjection and OpenFeature.Hosting recommendations. Compare the package-reference and service-registration alternatives described here. Done means generated projects use the selected official package and extension-method registration pattern while addressing the DI concerns in #208.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100