refactor(di): unify Application and Infrastructure DI registrations under a central method
- Added central AddEnvelopeGenerator extension to aggregate existing DI setups - Introduced EGConfiguration for modular service registration - Standardized configuration pattern for Application and Infrastructure layers - Simplified distributed cache and localization registration
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using EnvelopeGenerator.Application.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NLog;
|
||||
using Quartz;
|
||||
@@ -16,7 +15,6 @@ using EnvelopeGenerator.Web.Sanitizers;
|
||||
using EnvelopeGenerator.Web.Models.Annotation;
|
||||
using DigitalData.UserManager.DependencyInjection;
|
||||
using EnvelopeGenerator.Web.Middleware;
|
||||
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||
|
||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||
logger.Info("Logging initialized!");
|
||||
@@ -103,7 +101,7 @@ try
|
||||
|
||||
// Add envelope generator services
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
builder.Services.AddEnvelopeGeneratorInfrastructureServices(
|
||||
builder.Services.AddEGInfrastructureServices(
|
||||
opt =>
|
||||
{
|
||||
opt.AddDbTriggerParams(config);
|
||||
@@ -186,11 +184,6 @@ try
|
||||
builder.Services.Configure<Cultures>(config.GetSection("Cultures"));
|
||||
builder.Services.AddSingleton(sp => sp.GetRequiredService<IOptions<Cultures>>().Value);
|
||||
|
||||
// Register mail services
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
builder.Services.AddScoped<IEnvelopeMailService, EnvelopeMailService>();
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
builder.Services.AddDispatcher<EGDbContext>();
|
||||
|
||||
builder.ConfigureBySection<CustomImages>();
|
||||
|
||||
Reference in New Issue
Block a user