File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/Identity/EntityFrameworkCore/test/EF.Test/Utilities Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 44using System . Data . Common ;
55using Microsoft . Data . Sqlite ;
66using Microsoft . EntityFrameworkCore ;
7+ using Microsoft . Extensions . DependencyInjection ;
78
89namespace Microsoft . AspNetCore . Identity . EntityFrameworkCore . Test ;
910
@@ -23,7 +24,14 @@ public ScratchDatabaseFixture()
2324 }
2425
2526 private DbContext CreateEmptyContext ( )
26- => new DbContext ( new DbContextOptionsBuilder ( ) . UseSqlite ( _connection ) . Options ) ;
27+ {
28+ var services = new ServiceCollection ( ) ;
29+ services . Configure < IdentityOptions > ( options => options . Stores . SchemaVersion = IdentitySchemaVersions . Version3 ) ;
30+ return new DbContext ( new DbContextOptionsBuilder ( )
31+ . UseSqlite ( _connection )
32+ . UseApplicationServiceProvider ( services . BuildServiceProvider ( ) )
33+ . Options ) ;
34+ }
2735
2836 public DbConnection Connection => _connection ;
2937
You can’t perform that action at this time.
0 commit comments