Skip to content

Commit

Permalink
Devart.Data.Oracle.EFCore is supported net 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
maliming committed Dec 7, 2020
1 parent d20707a commit 3b265dd
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 96 deletions.
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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<!--<PackageReference Include="Devart.Data.Oracle.EFCore" Version="9.11.1034" />-->
<PackageReference Include="Devart.Data.Oracle.EFCore" Version="9.14.1150" />
</ItemGroup>

</Project>
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);
});
}
}
}
}
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);
});
}
}
}
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;
}
});
}
}
}
2 changes: 1 addition & 1 deletion nupkg/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ $projects = (
"framework/src/Volo.Abp.EntityFrameworkCore",
"framework/src/Volo.Abp.EntityFrameworkCore.MySQL",
# "framework/src/Volo.Abp.EntityFrameworkCore.Oracle",
# "framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart",
"framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart",
"framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql",
"framework/src/Volo.Abp.EntityFrameworkCore.Sqlite",
"framework/src/Volo.Abp.EntityFrameworkCore.SqlServer",
Expand Down

0 comments on commit 3b265dd

Please sign in to comment.