Browse Source

Change how to replace the payment dbcontext.

pull/74/head
Halil İbrahim Kalkan 5 years ago
parent
commit
ed84cef374
  1. 6
      src/EventHub.EntityFrameworkCore/EntityFrameworkCore/EventHubEntityFrameworkCoreModule.cs
  2. 2
      src/EventHub.EntityFrameworkCore/EntityFrameworkCore/Payment/EventHubPaymentDbContext.cs

6
src/EventHub.EntityFrameworkCore/EntityFrameworkCore/EventHubEntityFrameworkCoreModule.cs

@ -48,11 +48,7 @@ namespace EventHub.EntityFrameworkCore
}); });
/* Registering the payment dbcontext and replacing the module's dbcontext */ /* Registering the payment dbcontext and replacing the module's dbcontext */
context.Services.AddAbpDbContext<EventHubPaymentDbContext>(options => context.Services.AddAbpDbContext<EventHubPaymentDbContext>();
{
options.ReplaceDbContext<IPaymentDbContext>();
options.AddDefaultRepositories();
});
Configure<AbpDbContextOptions>(options => Configure<AbpDbContextOptions>(options =>
{ {

2
src/EventHub.EntityFrameworkCore/EntityFrameworkCore/Payment/EventHubPaymentDbContext.cs

@ -3,10 +3,12 @@ using Payment;
using Payment.EntityFrameworkCore; using Payment.EntityFrameworkCore;
using Payment.PaymentRequests; using Payment.PaymentRequests;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
namespace EventHub.EntityFrameworkCore.Payment namespace EventHub.EntityFrameworkCore.Payment
{ {
[ReplaceDbContext(typeof(IPaymentDbContext))]
[ConnectionStringName(PaymentDbProperties.ConnectionStringName)] [ConnectionStringName(PaymentDbProperties.ConnectionStringName)]
public class EventHubPaymentDbContext : AbpDbContext<EventHubPaymentDbContext>, IPaymentDbContext public class EventHubPaymentDbContext : AbpDbContext<EventHubPaymentDbContext>, IPaymentDbContext
{ {

Loading…
Cancel
Save