예제 #1
0
        public async Task <ActionResult> GetCountries()
        {
            try
            {
                List <Country> result = await _detailRepository.GetCountries();

                if (result == null)
                {
                    return(NotFound());
                }

                return(Ok(result));
            }
            catch (Exception ex)
            {
                string error = ex.ToString();
                return(StatusCode(StatusCodes.Status500InternalServerError, "Error retriving countries from database"));
            }
        }