dotnet-sdk-contrib icon indicating copy to clipboard operation
dotnet-sdk-contrib copied to clipboard

Add fluent DI initialization to flagd

Open askpt opened this issue 8 months ago • 2 comments

The InMemoryProvider enables quick addition of a new provider through fluent initialization. We aim to implement similar functionality for flagd, allowing it to be seamlessly integrated using a fluent API.

For reference, see the existing implementation in the dotnet-sdk: FeatureBuilderExtensions.cs#L24.

For example, the desired implementation for flagd could look like this:

builder.Services.AddOpenFeature(openfeatureBuilder =>
{
    openfeatureBuilder.AddHostedFeatureLifecycle()
        .AddFlagd();
});

This fluent API approach would simplify the integration process and make it consistent with other providers.

askpt avatar Apr 28 '25 19:04 askpt

Should this DI extension method be within the existing OpenFeature.Contrib.Providers.Flagd package? or within a seperate one?

kylejuliandev avatar May 11 '25 14:05 kylejuliandev

Should this DI extension method be within the existing OpenFeature.Contrib.Providers.Flagd package? or within a seperate one?

Please include it in the same package. Could be under OpenFeature.Contrib.Flagd.DependencyInjection.

askpt avatar May 12 '25 07:05 askpt