Update namespaces

This commit is contained in:
Aaron Po
2026-02-12 17:50:08 -05:00
parent 4f92741b4f
commit f728514a7c
19 changed files with 604 additions and 617 deletions

View File

@@ -1,24 +1,24 @@
using DBSeed;
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClient;
using DbUp;
using System.Reflection;
using Database.Seed;
string BuildConnectionString()
{
var server = Environment.GetEnvironmentVariable("DB_SERVER")
?? throw new InvalidOperationException("DB_SERVER environment variable is not set");
?? throw new InvalidOperationException("DB_SERVER environment variable is not set");
var dbName = Environment.GetEnvironmentVariable("DB_NAME")
?? throw new InvalidOperationException("DB_NAME environment variable is not set");
?? throw new InvalidOperationException("DB_NAME environment variable is not set");
var user = Environment.GetEnvironmentVariable("DB_USER")
?? throw new InvalidOperationException("DB_USER environment variable is not set");
?? throw new InvalidOperationException("DB_USER environment variable is not set");
var password = Environment.GetEnvironmentVariable("DB_PASSWORD")
?? throw new InvalidOperationException("DB_PASSWORD environment variable is not set");
?? throw new InvalidOperationException("DB_PASSWORD environment variable is not set");
var trustServerCertificate = Environment.GetEnvironmentVariable("DB_TRUST_SERVER_CERTIFICATE")
?? "True";
?? "True";
var builder = new SqlConnectionStringBuilder
{
@@ -33,6 +33,7 @@ string BuildConnectionString()
return builder.ConnectionString;
}
try
{
var connectionString = BuildConnectionString();
@@ -72,7 +73,6 @@ try
using (connection)
{
ISeeder[] seeders =
[
new LocationSeeder(),
@@ -96,4 +96,4 @@ catch (Exception ex)
Console.Error.WriteLine("Seed failed:");
Console.Error.WriteLine(ex);
return 1;
}
}