mirror of https://github.com/abpframework/abp.git
8 changed files with 146 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||||
|
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
||||
|
<ConfigureAwait ContinueOnCapturedContext="false" /> |
||||
|
</Weavers> |
||||
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
||||
|
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
||||
|
<xs:element name="Weavers"> |
||||
|
<xs:complexType> |
||||
|
<xs:all> |
||||
|
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
||||
|
<xs:complexType> |
||||
|
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:all> |
||||
|
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:schema> |
||||
@ -0,0 +1,25 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<Import Project="..\..\..\configureawait.props" /> |
||||
|
<Import Project="..\..\..\common.props" /> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netstandard2.1</TargetFramework> |
||||
|
<AssemblyName>Volo.Abp.EntityFrameworkCore.Oracle</AssemblyName> |
||||
|
<PackageId>Volo.Abp.EntityFrameworkCore.Oracle</PackageId> |
||||
|
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
||||
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
||||
|
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
||||
|
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\Volo.Abp.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Oracle.EntityFrameworkCore" Version="3.19.0-beta1" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,26 @@ |
|||||
|
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, |
||||
|
bool useExistingConnectionIfAvailable = false) |
||||
|
{ |
||||
|
if (useExistingConnectionIfAvailable && context.ExistingConnection != null) |
||||
|
{ |
||||
|
return context.DbContextOptions.UseOracle(context.ExistingConnection, oracleOptionsAction); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return context.DbContextOptions.UseOracle(context.ConnectionString, oracleOptionsAction); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
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, |
||||
|
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); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
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