formatting

This commit is contained in:
Aaron Po
2026-08-24 01:08:55 -04:00
parent c825d99b0a
commit b64c42ebde
27 changed files with 166 additions and 136 deletions

View File

@@ -8,20 +8,23 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="idunno.Password.Generator" Version="2.0.0"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2"/>
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.11"/>
<PackageReference Include="Spectre.Console" Version="0.57.2"/>
<PackageReference Include="idunno.Password.Generator" Version="2.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.11" />
<PackageReference Include="Spectre.Console" Version="0.57.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Domain\Domain.Entities\Domain.Entities.csproj"/>
<ProjectReference Include="..\..\Infrastructure\Infrastructure.Sql\Infrastructure.Sql.csproj"/>
<ProjectReference Include="..\..\Features\Features.Breweries\Features.Breweries.csproj"/>
<ProjectReference Include="..\..\Features\Features.Auth\Features.Auth.csproj"/>
<ProjectReference Include="..\..\Features\Features.Locations\Features.Locations.csproj"/>
<ProjectReference Include="..\..\Domain\Domain.Entities\Domain.Entities.csproj" />
<ProjectReference Include="..\..\Infrastructure\Infrastructure.Sql\Infrastructure.Sql.csproj" />
<ProjectReference Include="..\..\Features\Features.Breweries\Features.Breweries.csproj" />
<ProjectReference Include="..\..\Features\Features.Auth\Features.Auth.csproj" />
<ProjectReference Include="..\..\Features\Features.Locations\Features.Locations.csproj" />
</ItemGroup>
<ItemGroup>
<None CopyToOutputDirectory="PreserveNewest" Include="SeedData\biergarten_seed_2026-08-24T01-52-09.841693Z.sqlite"/>
<None
CopyToOutputDirectory="PreserveNewest"
Include="SeedData\biergarten_seed_2026-08-24T01-52-09.841693Z.sqlite"
/>
</ItemGroup>
</Project>

View File

@@ -12,5 +12,6 @@ public class ConnectionStrings
public static string GetSqlServerConnectionString(IConfiguration configuration) =>
SqlConnectionStringHelper.BuildConnectionString(configuration);
public static string SqliteConnectionString => "Data Source=SeedData/biergarten_seed_2026-08-24T01-52-09.841693Z.sqlite";
public static string SqliteConnectionString =>
"Data Source=SeedData/biergarten_seed_2026-08-24T01-52-09.841693Z.sqlite";
}

View File

@@ -79,8 +79,8 @@ public sealed class NominatimReverseGeocoder : IDisposable
string addressLine1 = string.Join(
' ',
new[] { response.Address.HouseNumber, response.Address.Road }.Where(
part => !string.IsNullOrWhiteSpace(part)
new[] { response.Address.HouseNumber, response.Address.Road }.Where(part =>
!string.IsNullOrWhiteSpace(part)
)
);

View File

@@ -26,9 +26,7 @@ static async Task<int> RunAsync()
{
try
{
IConfiguration configuration = new ConfigurationBuilder()
.AddEnvironmentVariables()
.Build();
IConfiguration configuration = new ConfigurationBuilder().AddEnvironmentVariables().Build();
ServiceCollection services = [];
services.AddSingleton(configuration);
@@ -39,21 +37,17 @@ static async Task<int> RunAsync()
await using ServiceProvider provider = services.BuildServiceProvider();
IBreweryRepository breweryRepository =
provider.GetRequiredService<IBreweryRepository>();
ILocationRepository locationRepository =
provider.GetRequiredService<ILocationRepository>();
UserManager<ApplicationUser> userManager =
provider.GetRequiredService<UserManager<ApplicationUser>>();
IBreweryRepository breweryRepository = provider.GetRequiredService<IBreweryRepository>();
ILocationRepository locationRepository = provider.GetRequiredService<ILocationRepository>();
UserManager<ApplicationUser> userManager = provider.GetRequiredService<
UserManager<ApplicationUser>
>();
AnsiConsole.Write(new Rule("[bold green]Database Seeder[/]")
.LeftJustified());
AnsiConsole.MarkupLine(
"[grey]Connecting to SQLite source and loading seed data...[/]");
AnsiConsole.Write(new Rule("[bold green]Database Seeder[/]").LeftJustified());
AnsiConsole.MarkupLine("[grey]Connecting to SQLite source and loading seed data...[/]");
AnsiConsole.WriteLine();
PipelineSeedDataReader reader =
new(ConnectionStrings.SqliteConnectionString);
PipelineSeedDataReader reader = new(ConnectionStrings.SqliteConnectionString);
SeedData seedData = null!;
IReadOnlyList<Guid> postedByIds = [];
@@ -79,16 +73,14 @@ static async Task<int> RunAsync()
AnsiConsole.Write(BuildBreweryTable(seedData.Breweries));
AnsiConsole.WriteLine();
AnsiConsole.MarkupLine(
$"[green]✓[/] Loaded [bold]{seedData.Users.Count}[/] users.");
AnsiConsole.MarkupLine($"[green]✓[/] Loaded [bold]{seedData.Users.Count}[/] users.");
AnsiConsole.Write(BuildUserTable(seedData.Users));
AnsiConsole.WriteLine();
AnsiConsole.WriteLine("Seed data loaded successfully.");
AnsiConsole.Write(
new Rule("[bold green]Loading seed data into target database.[/]")
.LeftJustified()
new Rule("[bold green]Loading seed data into target database.[/]").LeftJustified()
);
await AnsiConsole
@@ -193,8 +185,7 @@ static async Task LoadBreweriesIntoDatabaseAsync(
const string placeholderAddressLine1 = "Address unavailable";
if (posterUserIds.Count == 0)
throw new InvalidOperationException(
"Cannot load breweries without any registered users.");
throw new InvalidOperationException("Cannot load breweries without any registered users.");
for (int i = 0; i < breweries.Count; i++)
{
@@ -294,4 +285,4 @@ static Table BuildUserTable(IReadOnlyList<UserRecord> users)
}
return table;
}
}