Ejemplo n.º 1
0
        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 }));
        }
Ejemplo n.º 2
0
 public IActionResult GetCountryByIsolation()
 {
     try
     {
         var country = _missionService.GetCountryByIsolation();
         return(Ok(country));
     }
     catch (Exception e)
     {
         // will log e.message
         return(StatusCode(500));
     }
 }
Ejemplo n.º 3
0
        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"));
            }
        }