Exemplo n.º 1
0
        public async Task <IActionResult> GetMonitors()
        {
            try
            {
                var user = await GetCurrentAuthenticatedUser();

                var monitors = await _monitorsRepository.GetMonitorsByUser(user);

                var monitorLogs
                    = await _monitoringService.Monitor
                          (monitors, _monitorsRepository, _monitorLogsRepository);

                monitors = await _monitorsRepository.GetMonitorsByUser(user);

                return(Ok(monitors));
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                return(BadRequest(new ErrorMessage(ex)));
            }
        }