Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add integration for C# using a custom .NET Source Generator for flag calls

Aperta
#171 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
cli, tooling

Direzione di ricerca

Inizia esaminando la generazione C# esistente della CLI e il materiale collegato su .NET Source Generators. Definisci l’input dei flag basato sugli attributi e i punti di integrazione prima di implementare il generatore e il supporto della CLI. Il lavoro è completo quando funzionano le chiamate C# generate, la documentazione e un esempio di utilizzo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Propose adding a new integration for C# to the CLI that leverages a custom .NET Source Generator. This generator will automatically create code for feature flag calls, streamlining flag management and usage in C# projects. We would keep the current csharp generation in the CLI but adding a new one for the source generators.

Motivation

  • Enable seamless integration of OpenFeature in C# projects by automating the generation of flag call code.
  • Reduce boilerplate and potential errors in flag usage.
  • Improve developer productivity and code maintainability.

Approach

  • Design and implement a custom .NET Source Generator that can parse feature flag definitions and generate corresponding C# code for flag calls.
  • Integrate this workflow into the OpenFeature CLI so C# developers can easily set up and use this functionality.
  • Provide documentation and usage examples for the new integration.

Tasks

  • Research .NET Source Generators and their integration points with OpenFeature.
  • Define the input format and configuration for flag definitions. I suggest using Attributes.
  • Implement the source generator logic.
  • Update the CLI to support C# integration using the generator.
  • Write documentation and sample usage code.

Additional Context

This enhancement would provide first-class support for C# developers using OpenFeature, leveraging modern .NET tooling to make flag usage safer and more efficient.

Example of generated code by CLI

using OpenFeature.Extensions.SourceGenerator;

[FeatureFlag]
private bool IsEnabled;

By leveraging source generators for the C# implementation, it would give more flexibility because anyone could potentially make use of it, even without using the CLI.

Notes

More info: https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/

Lingua principale
Go
Stelle
63
Fork
22
Merge medio
1h 27m
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-feature/cli

Tutte le issue di open-feature/cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.