File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
src/Identity/EntityFrameworkCore/test/EF.Test Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ public VersionTwoDbContext(DbContextOptions options)
24
24
}
25
25
}
26
26
27
+ public class VersionThreeDbContext : IdentityDbContext < IdentityUser , IdentityRole , string >
28
+ {
29
+ public VersionThreeDbContext ( DbContextOptions options )
30
+ : base ( options )
31
+ {
32
+ }
33
+ }
34
+
27
35
public class EmptyDbContext : IdentityDbContext < IdentityUser , IdentityRole , string >
28
36
{
29
37
public EmptyDbContext ( DbContextOptions options )
Original file line number Diff line number Diff line change @@ -20,29 +20,29 @@ public VersionThreeSchemaTest(ScratchDatabaseFixture fixture)
20
20
21
21
services
22
22
. AddSingleton < IConfiguration > ( new ConfigurationBuilder ( ) . Build ( ) )
23
- . AddDbContext < VersionTwoDbContext > ( o =>
23
+ . AddDbContext < VersionThreeDbContext > ( o =>
24
24
o . UseSqlite ( fixture . Connection )
25
25
. ConfigureWarnings ( b => b . Log ( CoreEventId . ManyServiceProvidersCreatedWarning ) ) )
26
26
. AddIdentity < IdentityUser , IdentityRole > ( o =>
27
27
{
28
28
// MaxKeyLength does not need to be set in version 3
29
29
o . Stores . SchemaVersion = IdentitySchemaVersions . Version3 ;
30
30
} )
31
- . AddEntityFrameworkStores < VersionTwoDbContext > ( ) ;
31
+ . AddEntityFrameworkStores < VersionThreeDbContext > ( ) ;
32
32
33
33
services . AddLogging ( ) ;
34
34
35
35
_builder = new ApplicationBuilder ( services . BuildServiceProvider ( ) ) ;
36
36
var scope = _builder . ApplicationServices . GetRequiredService < IServiceScopeFactory > ( ) . CreateScope ( ) ;
37
- var db = scope . ServiceProvider . GetRequiredService < VersionTwoDbContext > ( ) ;
37
+ var db = scope . ServiceProvider . GetRequiredService < VersionThreeDbContext > ( ) ;
38
38
db . Database . EnsureCreated ( ) ;
39
39
}
40
40
41
41
[ Fact ]
42
42
public void EnsureDefaultSchema ( )
43
43
{
44
44
using var scope = _builder . ApplicationServices . GetRequiredService < IServiceScopeFactory > ( ) . CreateScope ( ) ;
45
- var db = scope . ServiceProvider . GetRequiredService < VersionTwoDbContext > ( ) ;
45
+ var db = scope . ServiceProvider . GetRequiredService < VersionThreeDbContext > ( ) ;
46
46
VerifyVersion3Schema ( db ) ;
47
47
}
48
48
You can’t perform that action at this time.
0 commit comments