mirror of https://github.com/abpframework/abp.git
committed by
GitHub
5 changed files with 85 additions and 80 deletions
@ -1,26 +1,33 @@ |
|||
// using JetBrains.Annotations;
|
|||
// using Microsoft.EntityFrameworkCore;
|
|||
// using System;
|
|||
// using Oracle.EntityFrameworkCore.Infrastructure;
|
|||
// using Volo.Abp.EntityFrameworkCore.DependencyInjection;
|
|||
//
|
|||
// namespace Volo.Abp.EntityFrameworkCore
|
|||
// {
|
|||
// public static class AbpDbContextConfigurationContextOracleExtensions
|
|||
// {
|
|||
// public static DbContextOptionsBuilder UseOracle(
|
|||
// [NotNull] this AbpDbContextConfigurationContext context,
|
|||
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null)
|
|||
// {
|
|||
// TODO: UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
|
|||
// if (context.ExistingConnection != null)
|
|||
// {
|
|||
// return context.DbContextOptions.UseOracle(context.ExistingConnection, oracleOptionsAction);
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// return context.DbContextOptions.UseOracle(context.ConnectionString, oracleOptionsAction);
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
using JetBrains.Annotations; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System; |
|||
using Oracle.EntityFrameworkCore.Infrastructure; |
|||
using Volo.Abp.EntityFrameworkCore.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.EntityFrameworkCore |
|||
{ |
|||
public static class AbpDbContextConfigurationContextOracleExtensions |
|||
{ |
|||
public static DbContextOptionsBuilder UseOracle( |
|||
[NotNull] this AbpDbContextConfigurationContext context, |
|||
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) |
|||
{ |
|||
if (context.ExistingConnection != null) |
|||
{ |
|||
return context.DbContextOptions.UseOracle(context.ExistingConnection, optionsBuilder => |
|||
{ |
|||
optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); |
|||
oracleOptionsAction?.Invoke(optionsBuilder); |
|||
}); |
|||
} |
|||
else |
|||
{ |
|||
return context.DbContextOptions.UseOracle(context.ConnectionString, optionsBuilder => |
|||
{ |
|||
optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); |
|||
oracleOptionsAction?.Invoke(optionsBuilder); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,30 +1,30 @@ |
|||
// using JetBrains.Annotations;
|
|||
// using System;
|
|||
// using Oracle.EntityFrameworkCore.Infrastructure;
|
|||
//
|
|||
// namespace Volo.Abp.EntityFrameworkCore
|
|||
// {
|
|||
// public static class AbpDbContextOptionsOracleExtensions
|
|||
// {
|
|||
// 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);
|
|||
// });
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
using JetBrains.Annotations; |
|||
using System; |
|||
using Oracle.EntityFrameworkCore.Infrastructure; |
|||
|
|||
namespace Volo.Abp.EntityFrameworkCore |
|||
{ |
|||
public static class AbpDbContextOptionsOracleExtensions |
|||
{ |
|||
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); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,22 +1,20 @@ |
|||
// using Volo.Abp.Guids;
|
|||
// using Volo.Abp.Modularity;
|
|||
//
|
|||
// namespace Volo.Abp.EntityFrameworkCore.Oracle
|
|||
// {
|
|||
// [DependsOn(
|
|||
// typeof(AbpEntityFrameworkCoreModule)
|
|||
// )]
|
|||
// public class AbpEntityFrameworkCoreOracleModule : AbpModule
|
|||
// {
|
|||
// public override void ConfigureServices(ServiceConfigurationContext context)
|
|||
// {
|
|||
// Configure<AbpSequentialGuidGeneratorOptions>(options =>
|
|||
// {
|
|||
// if (options.DefaultSequentialGuidType == null)
|
|||
// {
|
|||
// options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary;
|
|||
// }
|
|||
// });
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.EntityFrameworkCore.Oracle |
|||
{ |
|||
[DependsOn(typeof(AbpEntityFrameworkCoreModule))] |
|||
public class AbpEntityFrameworkCoreOracleModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpSequentialGuidGeneratorOptions>(options => |
|||
{ |
|||
if (options.DefaultSequentialGuidType == null) |
|||
{ |
|||
options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary; |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue