|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Data.Common;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Volo.Abp.DependencyInjection;
|
|
|
|
@ -13,13 +14,20 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection
|
|
|
|
|
|
|
|
|
|
public string ConnectionStringName { get; }
|
|
|
|
|
|
|
|
|
|
public DbConnection ExistingConnection { get; }
|
|
|
|
|
|
|
|
|
|
public DbContextOptionsBuilder DbContextOptions { get; protected set; }
|
|
|
|
|
|
|
|
|
|
public AbpDbContextConfigurationContext(string connectionString, [CanBeNull] string connectionStringName, [NotNull] IServiceProvider serviceProvider)
|
|
|
|
|
public AbpDbContextConfigurationContext(
|
|
|
|
|
[NotNull] string connectionString,
|
|
|
|
|
[NotNull] IServiceProvider serviceProvider,
|
|
|
|
|
[CanBeNull] string connectionStringName,
|
|
|
|
|
[CanBeNull]DbConnection existingConnection)
|
|
|
|
|
{
|
|
|
|
|
ConnectionString = connectionString;
|
|
|
|
|
ConnectionStringName = connectionStringName;
|
|
|
|
|
ServiceProvider = serviceProvider;
|
|
|
|
|
ConnectionStringName = connectionStringName;
|
|
|
|
|
ExistingConnection = existingConnection;
|
|
|
|
|
|
|
|
|
|
DbContextOptions = new DbContextOptionsBuilder();
|
|
|
|
|
}
|
|
|
|
@ -30,8 +38,16 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection
|
|
|
|
|
{
|
|
|
|
|
public new DbContextOptionsBuilder<TDbContext> DbContextOptions => (DbContextOptionsBuilder<TDbContext>)base.DbContextOptions;
|
|
|
|
|
|
|
|
|
|
public AbpDbContextConfigurationContext(string connectionString, [CanBeNull] string connectionStringName, [NotNull] IServiceProvider serviceProvider)
|
|
|
|
|
: base(connectionString, connectionStringName, serviceProvider)
|
|
|
|
|
public AbpDbContextConfigurationContext(
|
|
|
|
|
string connectionString,
|
|
|
|
|
[NotNull] IServiceProvider serviceProvider,
|
|
|
|
|
[CanBeNull] string connectionStringName,
|
|
|
|
|
[CanBeNull] DbConnection existingConnection)
|
|
|
|
|
: base(
|
|
|
|
|
connectionString,
|
|
|
|
|
serviceProvider,
|
|
|
|
|
connectionStringName,
|
|
|
|
|
existingConnection)
|
|
|
|
|
{
|
|
|
|
|
base.DbContextOptions = new DbContextOptionsBuilder<TDbContext>();
|
|
|
|
|
}
|
|
|
|
|