public IActionResult Get() { try { var result = _countryRepository.GetAll(); if (result.Any()) { _logger.LogInformation("Successfully recieved Country Data."); return(Ok(result)); } else { _logger.LogError("No country data. Data - {0}", result); return(StatusCode(400, StatusCodes.ReturnStatusObject("No country data."))); } } catch (Exception e) { _logger.LogError("Error recieving data. Error - {0}. Data - {1}", e.Message); return(StatusCode(400, StatusCodes.ReturnStatusObject("Error recieving Country data."))); } }
public List <SelectListItem> GetAll() { return(_countryService.GetAll()); }
public async Task <ActionResult <IEnumerable <Country> > > GetAllCountry() { var countries = await repository.GetAll(); return(StatusCode(StatusCodes.Status200OK, countries)); }
public IEnumerable <CountryDTO> GetCountry() { return(Counobj.GetAll()); }
public IActionResult Get() { var results = _country.GetAll(); return(Ok(results)); }