Пример #1
0
        public async Task Execute(PerformContext context, int id)
        {
            _logger.LogDebug("Starting job.");

            var widget = await _service.GetAsync(id);

            _logger.LogDebug("Processing Widget #{0} {1}...", widget.Id, widget.Name);

            for (int i = 0; i < 10; i++)
            {
                _logger.LogDebug("Doing Stuff...");
                Thread.Sleep(1000);
            }

            widget.Processing = false;

            await _service.UpdateAsync(widget);

            _logger.LogDebug("Processed Widget #{0} {1}.", widget.Id, widget.Name);

            context.WriteLine("");
        }
Пример #2
0
 public async Task <ActionResult <Widget> > Get(int id)
 {
     return(await _service.GetAsync(id));
 }