Refactor DI and update dependencies
- Enhanced `AddAutoMapper` configuration for flexibility. - Replaced `IEnvelopeMailService` with `IEnvelopeNotificationService`. - Migrated from `IUserRepository` to `EGDbContext` for data access. - Updated RabbitMQ configuration to use `AddMessagingServiceHttpClient`. - Removed `AddUserManager` and `AddDispatcher` registrations. - Added conditional `FluentValidation` dependencies for target frameworks. - Upgraded `MediatR` to 14.2.0 and `AutoMapper` to 16.2.0. - Added `HtmlSanitizer` dependency. - Improved error handling and logging in `ReadOnlyController`.
This commit is contained in:
@@ -31,12 +31,15 @@ public static class DependencyInjection
|
||||
$"MessagingServiceApiUrl must be provided when ClientType is set to Api in the '{sectionName}' configuration section.");
|
||||
break;
|
||||
case ConsumerType.RabbitMQ:
|
||||
if(options.RabbitMQ is not null)
|
||||
services.AddMessagingServiceClient(ntfConfiguration, nameof(options.RabbitMQ));
|
||||
if (options.ApiUrl is string rabbitModeApiUrl)
|
||||
services.AddMessagingServiceHttpClient(opt =>
|
||||
{
|
||||
opt.BaseAddress = new Uri(rabbitModeApiUrl);
|
||||
});
|
||||
else
|
||||
throw new InvalidOperationException(
|
||||
$"Missing RabbitMQ connection configuration." +
|
||||
$"When ClientType is set to RabbitMQ, a valid RabbitMQ configuration must be provided in the '{sectionName}' configuration section.");
|
||||
$"Missing API URL configuration." +
|
||||
$"When ClientType is set to RabbitMQ in an isolated host, Notification:ApiUrl must be provided in the '{sectionName}' configuration section.");
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException(
|
||||
|
||||
Reference in New Issue
Block a user