From 2e69c5fa1ef34638d4d07d0ab15446eb465a7bcb Mon Sep 17 00:00:00 2001 From: Vinod V Date: Sun, 7 Mar 2021 16:05:51 +0530 Subject: [PATCH] Oracle provider support --- src/EntityFrameworkCore.Generator.Core/CodeGenerator.cs | 9 +++++++++ .../EntityFrameworkCore.Generator.Core.csproj | 1 + .../Options/DatabaseProviders.cs | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/EntityFrameworkCore.Generator.Core/CodeGenerator.cs b/src/EntityFrameworkCore.Generator.Core/CodeGenerator.cs index ab75296b..e91db17e 100644 --- a/src/EntityFrameworkCore.Generator.Core/CodeGenerator.cs +++ b/src/EntityFrameworkCore.Generator.Core/CodeGenerator.cs @@ -412,6 +412,9 @@ private string ResolveConnectionString(DatabaseOptions database) case DatabaseProviders.Sqlite: ConfigureSqliteServices(services); break; + case DatabaseProviders.Oracle: + ConfigureOracleServices(services); + break; default: throw new NotSupportedException($"The specified provider '{provider}' is not supported."); } @@ -452,5 +455,11 @@ private void ConfigureSqliteServices(IServiceCollection services) var designTimeServices = new Microsoft.EntityFrameworkCore.Sqlite.Design.Internal.SqliteDesignTimeServices(); designTimeServices.ConfigureDesignTimeServices(services); } + + private void ConfigureOracleServices(IServiceCollection services) + { + var designTimeServices = new Oracle.EntityFrameworkCore.Design.Internal.OracleDesignTimeServices(); + designTimeServices.ConfigureDesignTimeServices(services); + } } } diff --git a/src/EntityFrameworkCore.Generator.Core/EntityFrameworkCore.Generator.Core.csproj b/src/EntityFrameworkCore.Generator.Core/EntityFrameworkCore.Generator.Core.csproj index 05ca0e86..a408c1df 100644 --- a/src/EntityFrameworkCore.Generator.Core/EntityFrameworkCore.Generator.Core.csproj +++ b/src/EntityFrameworkCore.Generator.Core/EntityFrameworkCore.Generator.Core.csproj @@ -27,6 +27,7 @@ + diff --git a/src/EntityFrameworkCore.Generator.Core/Options/DatabaseProviders.cs b/src/EntityFrameworkCore.Generator.Core/Options/DatabaseProviders.cs index e0093c87..5913f216 100644 --- a/src/EntityFrameworkCore.Generator.Core/Options/DatabaseProviders.cs +++ b/src/EntityFrameworkCore.Generator.Core/Options/DatabaseProviders.cs @@ -25,6 +25,11 @@ public enum DatabaseProviders /// /// The sqlite provider /// - Sqlite + Sqlite, + + /// + /// The Oracle provider + /// + Oracle } } \ No newline at end of file