From 183714c93fa7062611acd94ecb84b2d01a1ed9f5 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Mon, 26 Aug 2024 13:27:07 +0200 Subject: [PATCH] feat(Solution): Replaced plugin-based services by explicit implementations --- .../CloudStreams.Broker.Api.csproj | 5 ++--- .../CloudStreams.Broker.Application.csproj | 2 +- .../CloudStreams.Core.Api.csproj | 9 +++++---- .../CloudStreamsApplicationBuilder.cs | 20 +++++++++++++------ .../CloudStreams.Core.Application.csproj | 4 ++-- .../CloudStreams.Core.csproj | 6 +++--- .../CloudStreams.Gateway.Api.csproj | 5 ++--- .../CloudStreams.Gateway.Application.csproj | 2 +- 8 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/broker/CloudStreams.Broker.Api/CloudStreams.Broker.Api.csproj b/src/broker/CloudStreams.Broker.Api/CloudStreams.Broker.Api.csproj index bb757db..c48b299 100644 --- a/src/broker/CloudStreams.Broker.Api/CloudStreams.Broker.Api.csproj +++ b/src/broker/CloudStreams.Broker.Api/CloudStreams.Broker.Api.csproj @@ -27,9 +27,8 @@ - - - + + diff --git a/src/broker/CloudStreams.Broker.Application/CloudStreams.Broker.Application.csproj b/src/broker/CloudStreams.Broker.Application/CloudStreams.Broker.Application.csproj index 9839e15..7d8c84d 100644 --- a/src/broker/CloudStreams.Broker.Application/CloudStreams.Broker.Application.csproj +++ b/src/broker/CloudStreams.Broker.Application/CloudStreams.Broker.Application.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/core/CloudStreams.Core.Api/CloudStreams.Core.Api.csproj b/src/core/CloudStreams.Core.Api/CloudStreams.Core.Api.csproj index 3b69e01..71b9891 100644 --- a/src/core/CloudStreams.Core.Api/CloudStreams.Core.Api.csproj +++ b/src/core/CloudStreams.Core.Api/CloudStreams.Core.Api.csproj @@ -28,10 +28,11 @@ - - - - + + + + + diff --git a/src/core/CloudStreams.Core.Api/Services/CloudStreamsApplicationBuilder.cs b/src/core/CloudStreams.Core.Api/Services/CloudStreamsApplicationBuilder.cs index b290f26..d92e3c0 100644 --- a/src/core/CloudStreams.Core.Api/Services/CloudStreamsApplicationBuilder.cs +++ b/src/core/CloudStreams.Core.Api/Services/CloudStreamsApplicationBuilder.cs @@ -19,10 +19,10 @@ using Microsoft.AspNetCore.ResponseCompression; using Microsoft.OpenApi.Models; using Neuroglia.Data.Expressions.JQ; -using Neuroglia.Data.Infrastructure.EventSourcing.Services; +using Neuroglia.Data.Infrastructure.EventSourcing; +using Neuroglia.Data.Infrastructure.ResourceOriented.Redis; using Neuroglia.Data.PatchModel.Services; using Neuroglia.Mediation.Services; -using Neuroglia.Plugins; using Neuroglia.Security.Services; using Neuroglia.Serialization.Json; using Neuroglia.Serialization.Yaml; @@ -50,6 +50,8 @@ public class CloudStreamsApplicationBuilder /// The service used to configure and build logging public CloudStreamsApplicationBuilder(ConfigurationManager configuration, IHostEnvironment environment, IServiceCollection services, ILoggingBuilder logging) { + var esdbConnectionString = configuration.GetConnectionString("eventstore")!; + var redisConnectionString = configuration.GetConnectionString("redis")!; this.Configuration = configuration; this.Environment = environment; this.Services = services; @@ -71,10 +73,16 @@ public CloudStreamsApplicationBuilder(ConfigurationManager configuration, IHostE this.Services.AddSingleton(); this.Services.AddSingleton(); this.Services.AddSingleton(); - this.Services.AddPluginProvider(this.Configuration); - this.Services.AddPlugin(); - this.Services.AddPlugin(); - this.Services.AddPlugin(); + //this.Services.AddPluginProvider(this.Configuration); + //this.Services.AddPlugin(); + //this.Services.AddPlugin(); + //this.Services.AddPlugin(); + this.Services.AddEventStoreClient(esdbConnectionString); + this.Services.AddEventStorePersistentSubscriptionsClient(esdbConnectionString); + this.Services.AddEventStoreProjectionManagementClient(esdbConnectionString); + this.Services.AddEsdbEventStore(); + this.Services.AddEsdbProjectionManager(); + this.Services.AddRedisDatabase(redisConnectionString); this.Services.AddSingleton(); this.Services.AddSingleton(provider => provider.GetRequiredService()); this.Services.AddSingleton(provider => provider.GetRequiredService()); diff --git a/src/core/CloudStreams.Core.Application/CloudStreams.Core.Application.csproj b/src/core/CloudStreams.Core.Application/CloudStreams.Core.Application.csproj index b7ba346..a06474b 100644 --- a/src/core/CloudStreams.Core.Application/CloudStreams.Core.Application.csproj +++ b/src/core/CloudStreams.Core.Application/CloudStreams.Core.Application.csproj @@ -20,8 +20,8 @@ - - + + diff --git a/src/core/CloudStreams.Core/CloudStreams.Core.csproj b/src/core/CloudStreams.Core/CloudStreams.Core.csproj index 88bf3a8..204a51f 100644 --- a/src/core/CloudStreams.Core/CloudStreams.Core.csproj +++ b/src/core/CloudStreams.Core/CloudStreams.Core.csproj @@ -31,9 +31,9 @@ - - - + + + diff --git a/src/gateway/CloudStreams.Gateway.Api/CloudStreams.Gateway.Api.csproj b/src/gateway/CloudStreams.Gateway.Api/CloudStreams.Gateway.Api.csproj index c87b8bc..3be799f 100644 --- a/src/gateway/CloudStreams.Gateway.Api/CloudStreams.Gateway.Api.csproj +++ b/src/gateway/CloudStreams.Gateway.Api/CloudStreams.Gateway.Api.csproj @@ -26,9 +26,8 @@ - - - + + diff --git a/src/gateway/CloudStreams.Gateway.Application/CloudStreams.Gateway.Application.csproj b/src/gateway/CloudStreams.Gateway.Application/CloudStreams.Gateway.Application.csproj index 9fae7c0..e2d671e 100644 --- a/src/gateway/CloudStreams.Gateway.Application/CloudStreams.Gateway.Application.csproj +++ b/src/gateway/CloudStreams.Gateway.Application/CloudStreams.Gateway.Application.csproj @@ -20,7 +20,7 @@ - +