Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.Extensions.Options;
using OpenFeature.Hosting;
using OpenFeature.Hosting.Internal;
using OpenFeature.Isolated;

namespace OpenFeature;

Expand All @@ -24,7 +25,9 @@ public static IServiceCollection AddOpenFeature(this IServiceCollection services
Guard.ThrowIfNull(configure);

// Register core OpenFeature services as singletons.
services.TryAddSingleton(Api.Instance);
#pragma warning disable OFISO001 // Registering the isolated API instance as a singleton is intentional to ensure that all components within the application use the same isolated instance of the OpenFeature API. This design choice allows for the container to manage the lifecycle of the isolated API instance effectively.
services.TryAddSingleton(OpenFeatureFactory.CreateIsolated());
#pragma warning restore OFISO001
Comment thread
askpt marked this conversation as resolved.
services.TryAddSingleton<IFeatureLifecycleManager, FeatureLifecycleManager>();

var builder = new OpenFeatureBuilder(services);
Expand Down
Loading