File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 22using ServiceStack . Data ;
33using ServiceStack . OrmLite ;
44using MyApp . Data ;
5+ using Microsoft . EntityFrameworkCore . Diagnostics ;
56
67[ assembly: HostingStartup ( typeof ( MyApp . ConfigureDb ) ) ]
78
@@ -12,14 +13,16 @@ public class ConfigureDb : IHostingStartup
1213 public void Configure ( IWebHostBuilder builder ) => builder
1314 . ConfigureServices ( ( context , services ) => {
1415 var connectionString = context . Configuration . GetConnectionString ( "DefaultConnection" )
15- ?? "DataSource=App_Data/app.db;Cache=Shared" ;
16+ ?? "DataSource=App_Data/app.db;Cache=Shared" ;
1617
1718 services . AddOrmLite ( options => options . UseSqlite ( connectionString ) ) ;
1819
1920 // $ dotnet ef migrations add CreateIdentitySchema
2021 // $ dotnet ef database update
21- services . AddDbContext < ApplicationDbContext > ( options =>
22- options . UseSqlite ( connectionString , b => b . MigrationsAssembly ( nameof ( MyApp ) ) ) ) ;
22+ services . AddDbContext < ApplicationDbContext > ( options => {
23+ options . UseSqlite ( connectionString , b => b . MigrationsAssembly ( nameof ( MyApp ) ) ) ;
24+ options . ConfigureWarnings ( w => w . Ignore ( RelationalEventId . PendingModelChangesWarning ) ) ;
25+ } ) ;
2326
2427 // Enable built-in Database Admin UI at /admin-ui/database
2528 services . AddPlugin ( new AdminDatabaseFeature ( ) ) ;
You can’t perform that action at this time.
0 commit comments