File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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-
5146services . AddDbContext < ApplicationDbContext > ( options =>
5247 options . UseNpgsql ( AppHost . Connection , b => b . MigrationsAssembly ( nameof ( TechStacks ) ) ) ) ;
5348
Original file line number Diff line number Diff line change 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.*" />
You can’t perform that action at this time.
0 commit comments