zeroframework/Services/DeviceCenter/ZeroFramework.DeviceCenter.BackgroundTasks/Program.cs
2023-12-05 17:22:48 +08:00

25 lines
802 B
C#

using NLog.Extensions.Logging;
using ZeroFramework.DeviceCenter.Application;
using ZeroFramework.DeviceCenter.BackgroundTasks.Services;
using ZeroFramework.DeviceCenter.Domain;
using ZeroFramework.DeviceCenter.Infrastructure;
IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices((context, services) =>
{
services.AddHttpClient();
services.AddDomainLayer();
services.AddInfrastructureLayer(context.Configuration);
services.AddApplicationLayer(context.Configuration);
services.AddLocalization(options => options.ResourcesPath = "Resources");
services.AddLogging(options => options.ClearProviders().AddNLog());
services.AddHttpClient();
services.AddHostedService<MockSampleWorker>();
})
.Build();
host.Run();