21 lines
670 B
C#
Raw Normal View History

2025-05-27 14:02:24 +08:00
namespace JiShe.ServicePro.HttpApi.Client.ConsoleTestApp
2025-03-11 10:24:11 +08:00
{
public class ConsoleTestAppHostedService : IHostedService
{
public async Task StartAsync(CancellationToken cancellationToken)
{
2025-05-27 14:02:24 +08:00
using (var application = AbpApplicationFactory.Create<ServiceProConsoleApiClientModule>())
2025-03-11 10:24:11 +08:00
{
application.Initialize();
var demo = application.ServiceProvider.GetRequiredService<ClientDemoService>();
await demo.RunAsync();
application.Shutdown();
}
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
}