2023-08-25 15:32:06 +10:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using PARR.BLL;
|
|
|
|
|
|
using PARR.DAL;
|
2023-11-22 14:19:15 +10:00
|
|
|
|
using PARR.EsppSync;
|
|
|
|
|
|
using PARR.EsppTemplateSync.Domain;
|
2023-08-28 16:03:39 +10:00
|
|
|
|
using PARR.EsppTemplateSync.Settings;
|
2023-08-25 15:32:06 +10:00
|
|
|
|
|
|
|
|
|
|
namespace PARR.EsppTemplateSync
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class EsppTemplateSyncInstaller
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void InstallEsppTemplateSyncServices(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
|
{
|
2025-08-06 10:33:55 +10:00
|
|
|
|
services.InstallDalServices(configuration);
|
2023-08-25 15:32:06 +10:00
|
|
|
|
services.InstallBllServices(configuration);
|
2023-11-22 14:19:15 +10:00
|
|
|
|
services.InstallEsppSyncServices<EsppObjectTemplate>(configuration);
|
2023-08-25 15:32:06 +10:00
|
|
|
|
|
2023-08-28 16:03:39 +10:00
|
|
|
|
var globalSettings = new GlobalSettings();
|
|
|
|
|
|
configuration.GetSection(nameof(GlobalSettings)).Bind(globalSettings);
|
|
|
|
|
|
services.AddSingleton(globalSettings);
|
|
|
|
|
|
|
2023-08-31 12:04:05 +10:00
|
|
|
|
services.AddTransient<ITemplateSyncer, TemplateMQSyncer>();
|
2023-08-25 15:32:06 +10:00
|
|
|
|
}
|
2023-09-29 15:19:05 +10:00
|
|
|
|
|
|
|
|
|
|
public static IConfigurationBuilder AddEsppTemplateConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.AddDalConfigurations(services);
|
|
|
|
|
|
|
|
|
|
|
|
return builder;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void AddEsppTemplateSettings(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
|
{
|
|
|
|
|
|
services.AddDallSettings(configuration);
|
|
|
|
|
|
}
|
2023-08-25 15:32:06 +10:00
|
|
|
|
}
|
|
|
|
|
|
}
|