public async Task <IActionResult> GetCountryByIsolation() { (string country, int degreeOfIsolation) = await _missionService.GetCountryByIsolation(); if (string.IsNullOrEmpty(country)) { return(NotFound()); } return(Ok(new { Country = country, degreeOfIsolation = degreeOfIsolation })); }
public IActionResult GetCountryByIsolation() { try { var country = _missionService.GetCountryByIsolation(); return(Ok(country)); } catch (Exception e) { // will log e.message return(StatusCode(500)); } }
public async Task <ActionResult <string> > Get() { try { var result = await _missionService.GetCountryByIsolation(); if (String.IsNullOrEmpty(result)) { return(NoContent()); } return(result); } catch { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Internal Server Error")); } }