refatco and cleanup

This commit is contained in:
Paul Schneider 2026-07-05 17:54:36 +01:00
commit 4d51267dfd
66 changed files with 32 additions and 1619 deletions

View file

@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using isnd.Entities;
using Microsoft.AspNetCore.Hosting;
using Unleash;
using Unleash.ClientFactory;
namespace isnd.Helpers
{
/**
* Helper class for creating an Unleash client.
*/
public static class UnleashHelpers
{
/**
* Creates an Unleash client using the provided environment and settings.
* @param env The web host environment.
* @param unleashClientSettings The settings for the Unleash client.
* @returns An instance of IUnleash.
*/
public static IUnleash CreateUnleashClient(this IWebHostEnvironment env,
UnleashClientSettings unleashClientSettings)
{
var unleashSettings = new UnleashSettings
{
UnleashApi = new Uri(unleashClientSettings.ApiUrl),
AppName = "isnd",
InstanceTag = env.EnvironmentName,
CustomHttpHeaders = new Dictionary<string, string>
{
{ "Authorization", unleashClientSettings.ClientApiKey }
}
};
UnleashClientFactory unleashClientFactory = new UnleashClientFactory();
return unleashClientFactory.CreateClient(unleashSettings);
}
}
}