Browse Source

Update Entity-Framework-Core-Oracle.md

pull/4221/head
Halil İbrahim Kalkan 6 years ago
parent
commit
d6a19c9ad8
  1. 11
      docs/en/Entity-Framework-Core-Oracle.md

11
docs/en/Entity-Framework-Core-Oracle.md

@ -22,19 +22,19 @@ Find `UseSqlServer()` calls in your solution, replace with `UseOracle()`. Check
In the `CreateDbContext()` method of the *YourProjectName*MigrationsDbContextFactory.cs, replace the following code block
```
```csharp
var builder = new DbContextOptionsBuilder<YourProjectNameMigrationsDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));
```
with this one
```
```csharp
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.
@ -44,11 +44,6 @@ Oracle connection strings are different than SQL Server connection strings. So,
You typically will change the `appsettings.json` inside the `.DbMigrator` and `.Web` projects, but it depends on your solution structure.
A sample connection string for Oracle:
```
Data Source=localhost;User Id=myuser;Password=mypassword;
```
## Re-Generate the Migrations
The startup template uses [Entity Framework Core's Code First Migrations](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/) by default.

Loading…
Cancel
Save