Browse Source
add casting when use UseOracle for builder.Options
pull/4161/head
Alper Ebicoglu
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
17 additions and
0 deletions
-
docs/en/Entity-Framework-Core-Oracle.md
|
|
|
@ -19,6 +19,23 @@ Find `UseSqlServer()` calls in your solution, replace with `UseOracle()`. Check |
|
|
|
* *YourProjectName*EntityFrameworkCoreModule.cs inside the `.EntityFrameworkCore` project. |
|
|
|
* *YourProjectName*MigrationsDbContextFactory.cs inside the `.EntityFrameworkCore.DbMigrations` project. |
|
|
|
|
|
|
|
|
|
|
|
In the `CreateDbContext()` method of the *YourProjectName*MigrationsDbContextFactory.cs, replace the following code block |
|
|
|
|
|
|
|
``` |
|
|
|
var builder = new DbContextOptionsBuilder<YourProjectNameMigrationsDbContext>() |
|
|
|
.UseSqlServer(configuration.GetConnectionString("Default")); |
|
|
|
``` |
|
|
|
|
|
|
|
with this one |
|
|
|
``` |
|
|
|
var builder = (DbContextOptionsBuilder<YourProjectNameMigrationsDbContext>) |
|
|
|
new DbContextOptionsBuilder<YourProjectNameMigrationsDbContext>().UseOracle |
|
|
|
( |
|
|
|
configuration.GetConnectionString("Default") |
|
|
|
); |
|
|
|
``` |
|
|
|
|
|
|
|
> Depending on your solution structure, you may find more code files need to be changed. |
|
|
|
|
|
|
|
## Change the Connection Strings |
|
|
|
|