From f05804ae5750b71b773f2dc03a396193945f8f55 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 29 May 2020 16:44:42 +0300 Subject: [PATCH] add casting when use UseOracle for builder.Options --- docs/en/Entity-Framework-Core-Oracle.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/en/Entity-Framework-Core-Oracle.md b/docs/en/Entity-Framework-Core-Oracle.md index 94b7b45f04..7a4e950943 100644 --- a/docs/en/Entity-Framework-Core-Oracle.md +++ b/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() + .UseSqlServer(configuration.GetConnectionString("Default")); +``` + +with this one +``` +var builder = (DbContextOptionsBuilder) + new DbContextOptionsBuilder().UseOracle + ( + configuration.GetConnectionString("Default") + ); +``` + > Depending on your solution structure, you may find more code files need to be changed. ## Change the Connection Strings