Skip to content

Commit 256f051

Browse files
committed
fix build
1 parent b1e6459 commit 256f051

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

TechStacks/Configure.AppHost.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ public void Configure(IWebHostBuilder builder) => builder
2323
// Configure ASP.NET Core IOC Dependencies
2424
services.AddSingleton<IMessageService>(c => new BackgroundMqService());
2525

26+
Connection = Environment.GetEnvironmentVariable("TECHSTACKS_DB") ??
27+
context.Configuration.GetConnectionString("DefaultConnection")
28+
?? throw new Exception("ConnectionStrings/DefaultConnection not found");
29+
Console.WriteLine($"DB: {AppHost.Connection}");
30+
2631
var dbFactory = new OrmLiteConnectionFactory(Connection, PostgreSqlDialect.Provider);
2732
services.AddSingleton<IDbConnectionFactory>(dbFactory);
2833

TechStacks/Program.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343

4444
// $ dotnet ef migrations add CreateIdentitySchema
4545
// $ dotnet ef database update
46-
AppHost.Connection = Environment.GetEnvironmentVariable("TECHSTACKS_DB") ??
47-
config.GetConnectionString("DefaultConnection")
48-
?? throw new Exception("ConnectionStrings/DefaultConnection not found");
49-
Console.WriteLine($"DB: {AppHost.Connection}");
50-
5146
services.AddDbContext<ApplicationDbContext>(options =>
5247
options.UseNpgsql(AppHost.Connection, b => b.MigrationsAssembly(nameof(TechStacks))));
5348

TechStacks/TechStacks.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.*" />
24-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.*" />
23+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.*" />
24+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.*" />
25+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
26+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0-rc.2" />
2527
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.*" />
2628
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.*" />
2729
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="8.*" />

0 commit comments

Comments
 (0)