forked from abpframework/abp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Devart.Data.Oracle.EFCore is supported net 5.
- Loading branch information
Showing
6 changed files
with
103 additions
and
96 deletions.
There are no files selected for viewing
26 changes: 13 additions & 13 deletions
26
...meworkCore.Oracle.Devart/Microsoft/EntityFrameworkCore/AbpOracleModelBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// using Volo.Abp.EntityFrameworkCore; | ||
// | ||
// namespace Microsoft.EntityFrameworkCore | ||
// { | ||
// public static class AbpOracleModelBuilderExtensions | ||
// { | ||
// public static void UseOracle( | ||
// this ModelBuilder modelBuilder) | ||
// { | ||
// modelBuilder.SetDatabaseProvider(EfCoreDatabaseProvider.Oracle); | ||
// } | ||
// } | ||
// } | ||
using Volo.Abp.EntityFrameworkCore; | ||
|
||
namespace Microsoft.EntityFrameworkCore | ||
{ | ||
public static class AbpOracleModelBuilderExtensions | ||
{ | ||
public static void UseOracle( | ||
this ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.SetDatabaseProvider(EfCoreDatabaseProvider.Oracle); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 34 additions & 27 deletions
61
...rt/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextOracleDevartExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
// 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, | ||
// bool useExistingConnectionIfAvailable = false) | ||
// { | ||
// TODO: UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); | ||
// if (useExistingConnectionIfAvailable && 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 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, | ||
bool useExistingConnectionIfAvailable = false) | ||
{ | ||
if (useExistingConnectionIfAvailable && 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); | ||
}); | ||
} | ||
} | ||
} | ||
} |
64 changes: 32 additions & 32 deletions
64
...e.Oracle.Devart/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsOracleDevartExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
// 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, | ||
// bool useExistingConnectionIfAvailable = false) | ||
// { | ||
// options.Configure(context => | ||
// { | ||
// context.UseOracle(oracleOptionsAction, useExistingConnectionIfAvailable); | ||
// }); | ||
// } | ||
// | ||
// public static void UseOracle<TDbContext>( | ||
// [NotNull] this AbpDbContextOptions options, | ||
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null, | ||
// bool useExistingConnectionIfAvailable = false) | ||
// where TDbContext : AbpDbContext<TDbContext> | ||
// { | ||
// options.Configure<TDbContext>(context => | ||
// { | ||
// context.UseOracle(oracleOptionsAction, useExistingConnectionIfAvailable); | ||
// }); | ||
// } | ||
// } | ||
// } | ||
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, | ||
bool useExistingConnectionIfAvailable = false) | ||
{ | ||
options.Configure(context => | ||
{ | ||
context.UseOracle(oracleOptionsAction, useExistingConnectionIfAvailable); | ||
}); | ||
} | ||
|
||
public static void UseOracle<TDbContext>( | ||
[NotNull] this AbpDbContextOptions options, | ||
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null, | ||
bool useExistingConnectionIfAvailable = false) | ||
where TDbContext : AbpDbContext<TDbContext> | ||
{ | ||
options.Configure<TDbContext>(context => | ||
{ | ||
context.UseOracle(oracleOptionsAction, useExistingConnectionIfAvailable); | ||
}); | ||
} | ||
} | ||
} |
44 changes: 22 additions & 22 deletions
44
...rt/Volo/Abp/EntityFrameworkCore/Oracle/Devart/AbpEntityFrameworkCoreOracleDevartModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
// using Volo.Abp.Guids; | ||
// using Volo.Abp.Modularity; | ||
// | ||
// namespace Volo.Abp.EntityFrameworkCore.Oracle.Devart | ||
// { | ||
// [DependsOn( | ||
// typeof(AbpEntityFrameworkCoreModule) | ||
// )] | ||
// public class AbpEntityFrameworkCoreOracleDevartModule : 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.Devart | ||
{ | ||
[DependsOn( | ||
typeof(AbpEntityFrameworkCoreModule) | ||
)] | ||
public class AbpEntityFrameworkCoreOracleDevartModule : AbpModule | ||
{ | ||
public override void ConfigureServices(ServiceConfigurationContext context) | ||
{ | ||
Configure<AbpSequentialGuidGeneratorOptions>(options => | ||
{ | ||
if (options.DefaultSequentialGuidType == null) | ||
{ | ||
options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary; | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters