diff --git a/EstateReportingAPI.BusinessLogic/EstateReportingAPI.BusinessLogic.csproj b/EstateReportingAPI.BusinessLogic/EstateReportingAPI.BusinessLogic.csproj index 55f07ea..6f4d479 100644 --- a/EstateReportingAPI.BusinessLogic/EstateReportingAPI.BusinessLogic.csproj +++ b/EstateReportingAPI.BusinessLogic/EstateReportingAPI.BusinessLogic.csproj @@ -7,11 +7,11 @@ - + - - - + + + diff --git a/EstateReportingAPI.Client/EstateReportingAPI.Client.csproj b/EstateReportingAPI.Client/EstateReportingAPI.Client.csproj index 4117090..a2b57d1 100644 --- a/EstateReportingAPI.Client/EstateReportingAPI.Client.csproj +++ b/EstateReportingAPI.Client/EstateReportingAPI.Client.csproj @@ -7,9 +7,9 @@ - + - + diff --git a/EstateReportingAPI.IntegrationTests/EstateReportingAPI.IntegrationTests.csproj b/EstateReportingAPI.IntegrationTests/EstateReportingAPI.IntegrationTests.csproj index 57f6c60..f077d50 100644 --- a/EstateReportingAPI.IntegrationTests/EstateReportingAPI.IntegrationTests.csproj +++ b/EstateReportingAPI.IntegrationTests/EstateReportingAPI.IntegrationTests.csproj @@ -7,10 +7,10 @@ - - - - + + + + @@ -22,13 +22,13 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - - - + + + diff --git a/EstateReportingAPI.Tests/EstateReportingAPI.Tests.csproj b/EstateReportingAPI.Tests/EstateReportingAPI.Tests.csproj index fd732b7..a4ea6d0 100644 --- a/EstateReportingAPI.Tests/EstateReportingAPI.Tests.csproj +++ b/EstateReportingAPI.Tests/EstateReportingAPI.Tests.csproj @@ -7,20 +7,20 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/EstateReportingAPI/Bootstrapper/MediatorRegistry.cs b/EstateReportingAPI/Bootstrapper/MediatorRegistry.cs index b283f35..e8b16c8 100644 --- a/EstateReportingAPI/Bootstrapper/MediatorRegistry.cs +++ b/EstateReportingAPI/Bootstrapper/MediatorRegistry.cs @@ -5,46 +5,15 @@ using SimpleResults; using System.Diagnostics.CodeAnalysis; using EstateReportingAPI.BusinessLogic.Queries; +using Shared.General; namespace EstateReportingAPI.Bootstrapper; [ExcludeFromCodeCoverage] public class MediatorRegistry : ServiceRegistry { public MediatorRegistry() { - this.AddTransient(); - - this.AddSingleton>, EstateRequestHandler >(); - this.AddSingleton>>, EstateRequestHandler>(); - - this.AddSingleton>>, OperatorRequestHandler>(); - this.AddSingleton>, OperatorRequestHandler>(); - - this.AddSingleton>, TransactionRequestHandler>(); - this.AddSingleton>, TransactionRequestHandler>(); - this.AddSingleton>, TransactionRequestHandler>(); - this.AddSingleton>, TransactionRequestHandler>(); - this.AddSingleton>, TransactionRequestHandler>(); - this.AddSingleton>, TransactionRequestHandler>(); - this.AddSingleton>>, TransactionRequestHandler>(); - - this.AddSingleton>,SettlementRequestHandler>(); - - - this.AddSingleton>>, CalendarRequestHandler>(); - this.AddSingleton>>, CalendarRequestHandler>(); - this.AddSingleton>>, CalendarRequestHandler>(); - - this.AddSingleton>>, MerchantRequestHandler>(); - this.AddSingleton>, MerchantRequestHandler>(); - this.AddSingleton>>, MerchantRequestHandler>(); - this.AddSingleton>, MerchantRequestHandler>(); - this.AddSingleton>>, MerchantRequestHandler>(); - this.AddSingleton>>, MerchantRequestHandler>(); - this.AddSingleton>>, MerchantRequestHandler>(); - - this.AddSingleton>>, ContractRequestHandler>(); - this.AddSingleton>>, ContractRequestHandler>(); - this.AddSingleton>, ContractRequestHandler>(); + this.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(EstateRequestHandler).Assembly)); + this.AddSingleton>(container => (serviceName) => ConfigurationReader.GetBaseServerUri(serviceName).OriginalString); } } diff --git a/EstateReportingAPI/EstateReportingAPI.csproj b/EstateReportingAPI/EstateReportingAPI.csproj index 44f70ac..48a32f3 100644 --- a/EstateReportingAPI/EstateReportingAPI.csproj +++ b/EstateReportingAPI/EstateReportingAPI.csproj @@ -10,32 +10,32 @@ - + - - + + - - + + - - - - + + + + - - - - - + + + + + diff --git a/EstateReportingAPI/Startup.cs b/EstateReportingAPI/Startup.cs index b9bdf0a..d6f5b22 100644 --- a/EstateReportingAPI/Startup.cs +++ b/EstateReportingAPI/Startup.cs @@ -57,8 +57,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF ConfigurationReader.Initialise(Configuration); app.UseMiddleware(); - app.AddRequestLogging(); - app.AddResponseLogging(); + app.AddRequestResponseLogging(); app.AddExceptionHandler(); app.UseRouting();