You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.8 KiB

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<IHostEnvironment>();
context.SetConsoleTitleOfConsoleApp("QadAgent", env.EnvironmentName);
Configure<AbpDbContextOptions>(options =>
{
options.UseSqlServer();
});
Configure<DataExchangeOptions>(configuration.GetSection("DataExchangeOptions"));
context.Services.AddHostedService<AgentHostedService>();
context.Services.AddAutoMapperObjectMapper<AgentModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<AgentModule>(validate: false);
});
}
public override async Task OnApplicationInitializationAsync(
ApplicationInitializationContext context)
{
await context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>().ConfigureAwait(false);
}
}