Unleash client instance as singleton

This commit is contained in:
Paul Schneider 2021-07-11 22:13:48 +01:00
commit cd7c0be03d
3 changed files with 14 additions and 7 deletions

View file

@ -19,17 +19,18 @@ namespace isn.Controllers
{
private readonly ILogger _logger;
private readonly ApplicationDbContext _dbContext;
private readonly IHostingEnvironment _env;
private readonly IUnleash _unleashĈlient;
public HomeController(
ApplicationDbContext dbContext,
IOptions<UnleashClientSettings> unleashClientSettings,
IHostingEnvironment env,
IUnleash unleashĈlient,
ILogger<HomeController> logger)
{
_logger = logger;
_dbContext = dbContext;
_unleashĈlient = env.CreateUnleahClient(unleashClientSettings.Value);
_unleashĈlient = unleashĈlient;
// _unleashĈlient = env.CreateUnleahClient(unleashClientSettings.Value);
}
public IActionResult Index()