public MappedEvents Map(EventsObject obj) { var mappedEvents = new MappedEvents { events = obj.Events.Select(eventObj => Map(eventObj)).ToList() }; _logger.LogInformation("Events mapped successfully"); return(mappedEvents); }
public async Task StartService() { while (true) { try { _apiEvents = await _eventDataHandler.LoadAndSaveData(); _mappedEvents = _eventMapping.Map(_apiEvents); await _distributionService.Distribute(_mappedEvents); _logger.LogInformation("EventsSevice successfully run"); } catch (Exception ex) { _logger.LogError("EventsService " + ex.StackTrace); throw; } Thread.Sleep(5000); } }