diff --git a/src/OpenFeature/Api.cs b/src/OpenFeature/Api.cs index 7c6f51b1..f778c659 100644 --- a/src/OpenFeature/Api.cs +++ b/src/OpenFeature/Api.cs @@ -48,9 +48,8 @@ private Api() { } public async Task SetProviderAsync(FeatureProvider featureProvider) { this._eventExecutor.RegisterDefaultFeatureProvider(featureProvider); - await this._repository - .SetProviderAsync(featureProvider, this.GetContext(), this.AfterInitialization, this.AfterError) - .ConfigureAwait(false); + await this._repository.SetProviderAsync(featureProvider, this.GetContext(), this.AfterInitialization, this.AfterError).ConfigureAwait(false); + } /// @@ -65,11 +64,8 @@ public async Task SetProviderAsync(string domain, FeatureProvider featureProvide { throw new ArgumentNullException(nameof(domain)); } - this._eventExecutor.RegisterClientFeatureProvider(domain, featureProvider); - await this._repository - .SetProviderAsync(domain, featureProvider, this.GetContext(), this.AfterInitialization, this.AfterError) - .ConfigureAwait(false); + await this._repository.SetProviderAsync(domain, featureProvider, this.GetContext(), this.AfterInitialization, this.AfterError).ConfigureAwait(false); } /// @@ -345,8 +341,7 @@ private async Task AfterInitialization(FeatureProvider provider) ProviderName = provider.GetMetadata()?.Name, }; - await this._eventExecutor.EventChannel.Writer - .WriteAsync(new Event { Provider = provider, EventPayload = eventPayload }).ConfigureAwait(false); + await this._eventExecutor.EventChannel.Writer.WriteAsync(new Event { Provider = provider, EventPayload = eventPayload }).ConfigureAwait(false); } /// @@ -354,9 +349,7 @@ await this._eventExecutor.EventChannel.Writer /// private async Task AfterError(FeatureProvider provider, Exception? ex) { - provider.Status = typeof(ProviderFatalException) == ex?.GetType() - ? ProviderStatus.Fatal - : ProviderStatus.Error; + provider.Status = typeof(ProviderFatalException) == ex?.GetType() ? ProviderStatus.Fatal : ProviderStatus.Error; var eventPayload = new ProviderEventPayload { Type = ProviderEventTypes.ProviderError, @@ -364,8 +357,7 @@ private async Task AfterError(FeatureProvider provider, Exception? ex) ProviderName = provider.GetMetadata()?.Name, }; - await this._eventExecutor.EventChannel.Writer - .WriteAsync(new Event { Provider = provider, EventPayload = eventPayload }).ConfigureAwait(false); + await this._eventExecutor.EventChannel.Writer.WriteAsync(new Event { Provider = provider, EventPayload = eventPayload }).ConfigureAwait(false); } } }