Skip to content

Commit 6cd9ff1

Browse files
committed
Update README.md
Corrected some mistakes in the sample code.
1 parent a7f9432 commit 6cd9ff1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ public class MyDbContext : DbContext
4343

4444
protected override void OnModelCreating(DbModelBuilder modelBuilder)
4545
{
46-
var sqliteConnectionInitializer = new SqliteCreateDatabaseIfNotExists<MyDbContext>(
47-
Database.Connection.ConnectionString, modelBuilder);
46+
var sqliteConnectionInitializer = new SqliteCreateDatabaseIfNotExists<MyDbContext>(modelBuilder);
4847
Database.SetInitializer(sqliteConnectionInitializer);
4948
}
5049
}
@@ -54,10 +53,10 @@ In a more advanced scenario, you may want to populate some core- or test-data af
5453
To do this, inherit from `SqliteDropCreateDatabaseAlways<>` or `SqliteCreateDatabaseIfNotExists<>` and override the `Seed(MyDbContext context)` function.
5554
This function will be called in a transaction once the database was created. This function is only executed if a new database was successfully created.
5655
```csharp
57-
public class MyDbContextContextInitializer : SqliteDropCreateDatabaseAlways<MyDbContext>
56+
public class MyDbContextInitializer : SqliteDropCreateDatabaseAlways<MyDbContext>
5857
{
59-
public MyDbContextInitializer(string connectionString, DbModelBuilder modelBuilder)
60-
: base(connectionString, modelBuilder) { }
58+
public MyDbContextInitializer(DbModelBuilder modelBuilder)
59+
: base(modelBuilder) { }
6160

6261
protected override void Seed(MyDbContext context)
6362
{

0 commit comments

Comments
 (0)