feat(mvp): complete Blazor UI + User Management + integration tests
This commit is contained in:
1 parent
b217c932e8
commit
38816aec8a
26 files changed
+1893
-45
No files matched your search
@@ -15,14 +15,17 @@ public static class DependencyInjection
|
||||
public static IServiceCollection AddInfrastructure(
|
||||
this IServiceCollection services,
|
||||
IConfiguration configuration,
|
||||
bool isTestEnvironment = false)
|
||||
string? environmentName = null)
|
||||
{
|
||||
var connectionString = Environment.GetEnvironmentVariable("DATABASE_URL")
|
||||
?? configuration.GetConnectionString("Default")
|
||||
?? "Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall";
|
||||
var env = environmentName ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production";
|
||||
var isTesting = env == "Testing";
|
||||
|
||||
if (!isTestEnvironment)
|
||||
if (!isTesting)
|
||||
{
|
||||
var connectionString = Environment.GetEnvironmentVariable("DATABASE_URL")
|
||||
?? configuration.GetConnectionString("Default")
|
||||
?? "Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall";
|
||||
|
||||
services.AddDbContext<AppDbContext>(options =>
|
||||
{
|
||||
options.UseNpgsql(connectionString, npgsql =>
|
||||
@@ -51,6 +54,7 @@ public static class DependencyInjection
|
||||
services.AddScoped<IAuthService, AuthService>();
|
||||
services.AddScoped<ISiteService, SiteService>();
|
||||
services.AddScoped<IAgentService, AgentService>();
|
||||
services.AddScoped<IUserService, UserService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user