mirror of https://github.com/abpframework/abp.git
3 changed files with 67 additions and 0 deletions
@ -0,0 +1,25 @@ |
|||||
|
using JetBrains.Annotations; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using System; |
||||
|
using Devart.Data.Oracle.Entity; |
||||
|
using Volo.Abp.EntityFrameworkCore.DependencyInjection; |
||||
|
|
||||
|
namespace Volo.Abp.EntityFrameworkCore |
||||
|
{ |
||||
|
public static class AbpDbContextConfigurationContextOracleDevartExtensions |
||||
|
{ |
||||
|
public static DbContextOptionsBuilder UseOracle( |
||||
|
[NotNull] this AbpDbContextConfigurationContext context, |
||||
|
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) |
||||
|
{ |
||||
|
if (context.ExistingConnection != null) |
||||
|
{ |
||||
|
return context.DbContextOptions.UseOracle(context.ExistingConnection, oracleOptionsAction); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return context.DbContextOptions.UseOracle(context.ConnectionString, oracleOptionsAction); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
using JetBrains.Annotations; |
||||
|
using System; |
||||
|
using Devart.Data.Oracle.Entity; |
||||
|
|
||||
|
namespace Volo.Abp.EntityFrameworkCore |
||||
|
{ |
||||
|
public static class AbpDbContextOptionsOracleDevartExtensions |
||||
|
{ |
||||
|
public static void UseOracle( |
||||
|
[NotNull] this AbpDbContextOptions options, |
||||
|
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) |
||||
|
{ |
||||
|
options.Configure(context => |
||||
|
{ |
||||
|
context.UseOracle(oracleOptionsAction); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
public static void UseOracle<TDbContext>( |
||||
|
[NotNull] this AbpDbContextOptions options, |
||||
|
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) |
||||
|
where TDbContext : AbpDbContext<TDbContext> |
||||
|
{ |
||||
|
options.Configure<TDbContext>(context => |
||||
|
{ |
||||
|
context.UseOracle(oracleOptionsAction); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.EntityFrameworkCore.Oracle.Devart |
||||
|
{ |
||||
|
[DependsOn( |
||||
|
typeof(AbpEntityFrameworkCoreModule) |
||||
|
)] |
||||
|
public class AbpEntityFrameworkCoreOracleDevartModule : AbpModule |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue