Browse Source
Merge pull request #855 from Y2zz/master
use Pomelo.EntityFrameworkCore.MySql
pull/859/head
Halil İbrahim Kalkan
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
9 additions and
9 deletions
-
framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo.Abp.EntityFrameworkCore.MySQL.csproj
-
framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextMySQLExtensions.cs
-
framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsMySQLExtensions.cs
|
|
|
@ -16,9 +16,9 @@ |
|
|
|
<ItemGroup> |
|
|
|
<ProjectReference Include="..\Volo.Abp.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.13" /> |
|
|
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
using JetBrains.Annotations; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using MySql.Data.EntityFrameworkCore.Infraestructure; |
|
|
|
using System; |
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
|
|
using Volo.Abp.EntityFrameworkCore.DependencyInjection; |
|
|
|
|
|
|
|
namespace Volo.Abp.EntityFrameworkCore |
|
|
|
@ -10,15 +10,15 @@ namespace Volo.Abp.EntityFrameworkCore |
|
|
|
{ |
|
|
|
public static DbContextOptionsBuilder UseMySQL( |
|
|
|
[NotNull] this AbpDbContextConfigurationContext context, |
|
|
|
[CanBeNull] Action<MySQLDbContextOptionsBuilder> mySQLOptionsAction = null) |
|
|
|
[CanBeNull] Action<MySqlDbContextOptionsBuilder> mySQLOptionsAction = null) |
|
|
|
{ |
|
|
|
if (context.ExistingConnection != null) |
|
|
|
{ |
|
|
|
return context.DbContextOptions.UseMySQL(context.ExistingConnection, mySQLOptionsAction); |
|
|
|
return context.DbContextOptions.UseMySql(context.ExistingConnection, mySQLOptionsAction); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return context.DbContextOptions.UseMySQL(context.ConnectionString, mySQLOptionsAction); |
|
|
|
return context.DbContextOptions.UseMySql(context.ConnectionString, mySQLOptionsAction); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
using JetBrains.Annotations; |
|
|
|
using MySql.Data.EntityFrameworkCore.Infraestructure; |
|
|
|
using System; |
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
|
|
|
|
|
|
namespace Volo.Abp.EntityFrameworkCore |
|
|
|
{ |
|
|
|
@ -8,7 +8,7 @@ namespace Volo.Abp.EntityFrameworkCore |
|
|
|
{ |
|
|
|
public static void UseMySQL( |
|
|
|
[NotNull] this AbpDbContextOptions options, |
|
|
|
[CanBeNull] Action<MySQLDbContextOptionsBuilder> mySQLOptionsAction = null) |
|
|
|
[CanBeNull] Action<MySqlDbContextOptionsBuilder> mySQLOptionsAction = null) |
|
|
|
{ |
|
|
|
options.Configure(context => |
|
|
|
{ |
|
|
|
@ -18,7 +18,7 @@ namespace Volo.Abp.EntityFrameworkCore |
|
|
|
|
|
|
|
public static void UseMySQL<TDbContext>( |
|
|
|
[NotNull] this AbpDbContextOptions options, |
|
|
|
[CanBeNull] Action<MySQLDbContextOptionsBuilder> mySQLOptionsAction = null) |
|
|
|
[CanBeNull] Action<MySqlDbContextOptionsBuilder> mySQLOptionsAction = null) |
|
|
|
where TDbContext : AbpDbContext<TDbContext> |
|
|
|
{ |
|
|
|
options.Configure<TDbContext>(context => |
|
|
|
|