Esempio n. 1
0
        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()
                });
            }
        }
Esempio n. 2
0
        public IActionResult Add([FromBody] Logger logger)
        {
            _serviceList.Add(logger);

            return(Ok($"{_serviceList.Count()} items in List"));
        }