using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundWorkers; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; using Win_in.Sfs.Shared.Host; using Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore; using Win_in.Sfs.Wms.DataExchange.Iac.QadAgent.Outgoing; namespace Win_in.Sfs.Wms.DataExchange.Iac.QadAgent; [DependsOn( typeof(AbpAutofacModule), typeof(AbpAutoMapperModule), typeof(AbpBackgroundJobsModule), typeof(AbpBackgroundWorkersModule) )] [DependsOn( typeof(DataExchangeDomainModule), typeof(DataExchangeEntityFrameworkCoreModule) )] public class AgentModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); var env = context.Services.GetSingletonInstance(); context.SetConsoleTitleOfConsoleApp("QadAgent", env.EnvironmentName); Configure(options => { options.UseSqlServer(); }); Configure(configuration.GetSection("DataExchangeOptions")); context.Services.AddHostedService(); context.Services.AddAutoMapperObjectMapper(); Configure(options => { options.AddMaps(validate: false); }); } public override async Task OnApplicationInitializationAsync( ApplicationInitializationContext context) { await context.AddBackgroundWorkerAsync().ConfigureAwait(false); } }