Browse Source

add casting when use UseOracle for builder.Options

pull/4161/head
Alper Ebicoglu 6 years ago
committed by GitHub
parent
commit
f05804ae57
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      docs/en/Entity-Framework-Core-Oracle.md

17
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*EntityFrameworkCoreModule.cs inside the `.EntityFrameworkCore` project.
* *YourProjectName*MigrationsDbContextFactory.cs inside the `.EntityFrameworkCore.DbMigrations` 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. > Depending on your solution structure, you may find more code files need to be changed.
## Change the Connection Strings ## Change the Connection Strings

Loading…
Cancel
Save