mirror of https://github.com/abpframework/abp
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
731 B
26 lines
731 B
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Volo.Abp;
|
|
|
|
namespace Volo.CmsKit;
|
|
|
|
public class ConsoleTestAppHostedService : IHostedService
|
|
{
|
|
public async Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
using (var application = AbpApplicationFactory.Create<CmsKitConsoleApiClientModule>())
|
|
{
|
|
application.Initialize();
|
|
|
|
var demo = application.ServiceProvider.GetRequiredService<ClientDemoService>();
|
|
await demo.RunAsync();
|
|
|
|
application.Shutdown();
|
|
}
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
|
}
|