From 91dec1e82d875cadba188ac859138c0625c0c204 Mon Sep 17 00:00:00 2001 From: BionStt <43228630+BionStt@users.noreply.github.com> Date: Sat, 1 Jan 2022 21:33:44 +0700 Subject: [PATCH] ok --- ModularMonolithOutBoxPattern.MVC/Program.cs | 2 +- ModularMonolithOutBoxPattern.sln | 2 +- Outbox/ServiceCollection.cs | 3 +++ .../EventBus/SalesMarketingEventBus.cs | 12 ++++++------ SalesMarketing/ServiceCollectionExtension.cs | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ModularMonolithOutBoxPattern.MVC/Program.cs b/ModularMonolithOutBoxPattern.MVC/Program.cs index 8737183..68b3d14 100644 --- a/ModularMonolithOutBoxPattern.MVC/Program.cs +++ b/ModularMonolithOutBoxPattern.MVC/Program.cs @@ -27,7 +27,7 @@ -builder.Services.AddHostedService(); +//builder.Services.AddHostedService(); //pindah kedalam module builder.Services.AddControllersWithViews().AddNewtonsoftJson(x => diff --git a/ModularMonolithOutBoxPattern.sln b/ModularMonolithOutBoxPattern.sln index 2201abd..0e39e61 100644 --- a/ModularMonolithOutBoxPattern.sln +++ b/ModularMonolithOutBoxPattern.sln @@ -15,7 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DDD", "DDD\DDD.csproj", "{7 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationEvent", "IntegrationEvent\IntegrationEvent.csproj", "{DEBE71CD-1282-4429-A7D3-9B03D9360245}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventBus", "EventBus\EventBus.csproj", "{6F8EE448-09E4-486E-9AD0-AA2D0708626E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBus", "EventBus\EventBus.csproj", "{6F8EE448-09E4-486E-9AD0-AA2D0708626E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Outbox/ServiceCollection.cs b/Outbox/ServiceCollection.cs index bcf79bb..58c1f4d 100644 --- a/Outbox/ServiceCollection.cs +++ b/Outbox/ServiceCollection.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Outbox.Infrastructure.Context; +using Outbox.WorkerProcess; using System; using System.Collections.Generic; using System.Linq; @@ -14,6 +15,8 @@ public static class ServiceCollection public static IServiceCollection AddOutBoxModule(this IServiceCollection services, string connectionString) { services.AddDbContext(options => options.UseSqlServer(connectionString)); + services.AddHostedService(); + return services; } } diff --git a/SalesMarketing/Infrastructure/EventBus/SalesMarketingEventBus.cs b/SalesMarketing/Infrastructure/EventBus/SalesMarketingEventBus.cs index f1e260e..42f70ca 100644 --- a/SalesMarketing/Infrastructure/EventBus/SalesMarketingEventBus.cs +++ b/SalesMarketing/Infrastructure/EventBus/SalesMarketingEventBus.cs @@ -10,10 +10,10 @@ namespace SalesMarketing.Infrastructure.EventBus { - public class SalesMarketingEventBus : InMemoryEventBus, ISalesMarketingEventBus - { - public SalesMarketingEventBus(OutboxDbContext dbContext) : base(dbContext) - { - } - } + //public class SalesMarketingEventBus : InMemoryEventBus, ISalesMarketingEventBus + //{ + // public SalesMarketingEventBus(OutboxDbContext dbContext) : base(dbContext) + // { + // } + //} } diff --git a/SalesMarketing/ServiceCollectionExtension.cs b/SalesMarketing/ServiceCollectionExtension.cs index d7b5a1c..e31756e 100644 --- a/SalesMarketing/ServiceCollectionExtension.cs +++ b/SalesMarketing/ServiceCollectionExtension.cs @@ -24,7 +24,7 @@ public static IServiceCollection AddSalesMarketingModule(this IServiceCollection - services.AddScoped(); + // services.AddScoped(); return services;