public async Task <IActionResult> GetTestRunLogAsync([FromBody] int id) { try { var testRunLog = await _meissaRepository.GetByIdAsync <TestRunLog>(id); if (testRunLog == null) { return(NotFound()); } var testRunLogDto = Mapper.Map <TestRunLogDto>(testRunLog); return(Ok(testRunLogDto)); } catch (Exception ex) { _logger.LogCritical($"Exception while getting test run with id {id}.", ex); return(StatusCode(500, "A problem happened while handling your request.")); } }
public async Task <IActionResult> GetTestRunAvailability([FromBody] int id) { try { var testRunAvailability = await _meissaRepository.GetByIdAsync <TestRunAvailability>(id); if (testRunAvailability == null) { _logger.LogInformation($"Test Run Availability with id {id} wasn't found."); return(NotFound()); } var testRunAvailabilityDto = Mapper.Map <TestRunAvailabilityDto>(testRunAvailability); return(Ok(testRunAvailabilityDto)); } catch (Exception ex) { _logger.LogCritical($"Exception while getting test run availability with id {id}.", ex); return(StatusCode(500, "A problem happened while handling your request.")); } }
public async Task <IActionResult> GetLog([FromBody] int id) { try { var log = await _meissaRepository.GetByIdAsync <Log>(id).ConfigureAwait(false); if (log == null) { _logger.LogInformation($"Log with id {id} wasn't found."); return(NotFound()); } var logDto = Mapper.Map <LogDto>(log); return(Ok(logDto)); } catch (Exception ex) { _logger.LogCritical($"Exception while getting test run with id {id}.", ex); return(StatusCode(500, "A problem happened while handling your request.")); } }