Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GrPe committed May 21, 2024
1 parent 0d444de commit 4e7cac3
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,16 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
services.Remove(dbContext);
}

var dbContextOptions = services.FirstOrDefault(x => x.ServiceType.Name.Contains("DbContextOptions"));
if (dbContextOptions is not null)
{
services.Remove(dbContextOptions);
}

var identityDb = services.FirstOrDefault(x => x.ServiceType.Name.Contains("ApplicationIdentityDbContext"));
if (identityDb is not null)
{
services.Remove(identityDb);
}

dbContextOptions = services.FirstOrDefault(x => x.ServiceType.Name.Contains("DbContextOptions"));
if (dbContextOptions is not null)
var options = services.Where(x => x.ServiceType.Name.Contains("DbContextOptions")).ToList();
foreach (var option in options)
{
services.Remove(dbContextOptions);
services.Remove(option);
}

services.AddDataAccess($"Host={_postgresHostname}:{_postgresPort};Database=overmoney;Username=dev;Password=dev;Timeout=300;CommandTimeout=300", applyMigrations: true);
Expand Down

0 comments on commit 4e7cac3

Please sign in to comment.