Files
parr_api/PARR.Test/Worker.cs
2023-10-19 16:55:42 +10:00

34 lines
916 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using PARR.EsppApi;
namespace PARR.Test
{
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
private readonly IEsppApiService esppApiService;
public Worker(ILogger<Worker> logger, IEsppApiService esppApiService)
{
_logger = logger;
this.esppApiService = esppApiService;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
//while (!stoppingToken.IsCancellationRequested)
//{
// _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
// await Task.Delay(1000, stoppingToken);
//}
await TestEsppApi();
}
private async Task TestEsppApi()
{
var orders = await esppApiService.FindOrdersByPrefixAsync(АРР__");
}
}
}