public override async Task StartAsync(CancellationToken cancellationToken) { Bootstrapper.Start(); await base.StartAsync(cancellationToken); Trace.Listeners.Add(new Trace2StdoutLogger()); Trace.TraceInformation("Worker.StartAsync"); _tLBotProcessor = Bootstrapper.Resolve <ITLBotProcessor>(); _tLBotProcessor.Start(Bootstrapper.Resolve <ITLBotService>(), cancellationToken); return; }
static void Main(string[] args) { Bootstrapper.Start(); _tLBotProcessor = Bootstrapper.Resolve <ITLBotProcessor>(); var tsk = Task.Run(() => { while (true) { } }); Task.WaitAll(tsk); /* IPerformanceData[] perfomances = _playBillResolver.RequestProcess(DateTime.Now, new DateTime(), GetFilter()).GetAwaiter().GetResult(); * * foreach (var item in perfomances.OrderBy(item => item.DateTime)) * { * string minPrice = item.Tickets.GetMinPrice().ToString() ?? item.Tickets.Description; * Trace.TraceInformation($"{item.DateTime:ddMMM HH:mm} {item.Location} {item.Type} \"{item.Name}\" от {minPrice}"); * Trace.TraceInformation($"{item.Url}"); * Trace.TraceInformation(""); * }*/ Bootstrapper.Stop(); }