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)
2424 }
2525}
2626
27+ public class VersionThreeDbContext : IdentityDbContext < IdentityUser , IdentityRole , string >
28+ {
29+ public VersionThreeDbContext ( DbContextOptions options )
30+ : base ( options )
31+ {
32+ }
33+ }
34+
2735public class EmptyDbContext : IdentityDbContext < IdentityUser , IdentityRole , string >
2836{
2937 public EmptyDbContext ( DbContextOptions options )
Original file line number Diff line number Diff line change @@ -20,29 +20,29 @@ public VersionThreeSchemaTest(ScratchDatabaseFixture fixture)
2020
2121 services
2222 . AddSingleton < IConfiguration > ( new ConfigurationBuilder ( ) . Build ( ) )
23- . AddDbContext < VersionTwoDbContext > ( o =>
23+ . AddDbContext < VersionThreeDbContext > ( o =>
2424 o . UseSqlite ( fixture . Connection )
2525 . ConfigureWarnings ( b => b . Log ( CoreEventId . ManyServiceProvidersCreatedWarning ) ) )
2626 . AddIdentity < IdentityUser , IdentityRole > ( o =>
2727 {
2828 // MaxKeyLength does not need to be set in version 3
2929 o . Stores . SchemaVersion = IdentitySchemaVersions . Version3 ;
3030 } )
31- . AddEntityFrameworkStores < VersionTwoDbContext > ( ) ;
31+ . AddEntityFrameworkStores < VersionThreeDbContext > ( ) ;
3232
3333 services . AddLogging ( ) ;
3434
3535 _builder = new ApplicationBuilder ( services . BuildServiceProvider ( ) ) ;
3636 var scope = _builder . ApplicationServices . GetRequiredService < IServiceScopeFactory > ( ) . CreateScope ( ) ;
37- var db = scope . ServiceProvider . GetRequiredService < VersionTwoDbContext > ( ) ;
37+ var db = scope . ServiceProvider . GetRequiredService < VersionThreeDbContext > ( ) ;
3838 db . Database . EnsureCreated ( ) ;
3939 }
4040
4141 [ Fact ]
4242 public void EnsureDefaultSchema ( )
4343 {
4444 using var scope = _builder . ApplicationServices . GetRequiredService < IServiceScopeFactory > ( ) . CreateScope ( ) ;
45- var db = scope . ServiceProvider . GetRequiredService < VersionTwoDbContext > ( ) ;
45+ var db = scope . ServiceProvider . GetRequiredService < VersionThreeDbContext > ( ) ;
4646 VerifyVersion3Schema ( db ) ;
4747 }
4848
You can’t perform that action at this time.
0 commit comments