private void DoWork(object state) { var count = Interlocked.Increment(ref executionCount); _logger.LogInformation( $"Timed Hosted Service is working. Count: {count}, Items: {_serviceList.Count()}"); if (_serviceList.Count() > 0) { _mediator.Send(new CreateManyLoggerCommand { Loggers = _serviceList.GetItems() }); } }
public IActionResult Add([FromBody] Logger logger) { _serviceList.Add(logger); return(Ok($"{_serviceList.Count()} items in List")); }