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 */
context.Services.AddAbpDbContext<EventHubPaymentDbContext>(options =>
{
options.ReplaceDbContext<IPaymentDbContext>();
options.AddDefaultRepositories();
});
context.Services.AddAbpDbContext<EventHubPaymentDbContext>();
Configure<AbpDbContextOptions>(options =>
{

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

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

Loading…
Cancel
Save