mirror of https://github.com/EasyAbp/EShop.git
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.
26 lines
853 B
26 lines
853 B
using Microsoft.Extensions.Hosting;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp;
|
|
|
|
namespace EasyAbp.EShop.HttpApi.Client.ConsoleTestApp
|
|
{
|
|
public class ConsoleTestAppHostedService : IHostedService
|
|
{
|
|
public async Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
using (var application = await AbpApplicationFactory.CreateAsync<EShopConsoleApiClientModule>())
|
|
{
|
|
await application.InitializeAsync();
|
|
|
|
var demo = application.ServiceProvider.GetRequiredService<ClientDemoService>();
|
|
await demo.RunAsync();
|
|
|
|
await application.ShutdownAsync();
|
|
}
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
|
}
|
|
}
|
|
|