public async Task <IEnumerable <HRRegion> > Get() { IEnumerable <HRRegion> retour = null; if (_regionsService != null) { try { //1- retour = await _regionsService.GetRegionsAsync(); } catch (Exception ex) { //2- ServiceErrorGenerator <HRRegion> serviceError = new ServiceErrorGenerator <HRRegion>(); retour = serviceError.GenerateErrors(ex.Message); } } else { //3- ServiceErrorGenerator <HRRegion> serviceError = new ServiceErrorGenerator <HRRegion>(); retour = serviceError.GenerateErrors(HRCountriesServicesSolution.Constant.REGION.REGION_SERVICE_ERROR_DESCRIPTION); } return(retour); }
public async Task <CountriesIteration> Region(String id = null) { if (_countriesIterationService != null) { try { //1- return(await _countriesIterationService.GetCountriesIterationByRegionAsync(id)); } catch (Exception ex) { //-2 ServiceErrorGenerator <CountriesIteration> serviceError = new ServiceErrorGenerator <CountriesIteration>(); return(serviceError.GenerateError(ex.Message)); } } else { //3- ServiceErrorGenerator <CountriesIteration> serviceError = new ServiceErrorGenerator <CountriesIteration>(); return(serviceError.GenerateError(HRCountriesServicesSolution.Constant.COUNTRIESITERATION.COUNTRIESITERATION_SERVICE_ERROR_DESCRIPTION)); } }
public async Task <WebCamsTravelRootObject> Get(String country, String capital) { if (_webCamsTravelService != null) { try { //1- return(await _webCamsTravelService.GetBestWebCam(country, capital)); } catch (Exception ex) { //2- ServiceErrorGenerator <WebCamsTravelRootObject> serviceError = new ServiceErrorGenerator <WebCamsTravelRootObject>(); return(serviceError.GenerateError(ex.Message)); } } else { //3- ServiceErrorGenerator <WebCamsTravelRootObject> serviceError = new ServiceErrorGenerator <WebCamsTravelRootObject>(); return(serviceError.GenerateError(HRCountriesServicesSolution.Constant.WEBCAMTRAVEL.WEBCAMS_TRAVEL_SERVICE_ERROR_DESCRIPTION)); } }
public async Task <HRCountryBorder> byAlpha3Code(String alpha3Code) { if (_borderService != null) { try { //1- return(await _borderService.GetBorderCountriesByAlpha3CodeAsync(alpha3Code)); } catch (Exception ex) { //2- ServiceErrorGenerator <HRCountryBorder> serviceError = new ServiceErrorGenerator <HRCountryBorder>(); return(serviceError.GenerateError(ex.Message)); } } else { //3- ServiceErrorGenerator <HRCountryBorder> serviceError = new ServiceErrorGenerator <HRCountryBorder>(); return(serviceError.GenerateError(HRCountriesServicesSolution.Constant.BOUNDARIES.BORDER_SERVICE_ERROR_DESCRIPTION)); } }
public async Task <IEnumerable <HRCountryBorder> > GetAsync() { if (_borderService != null) { try { //1- return(await _borderService.GetBorderCountriesAsync()); } catch (Exception ex) { //2- ServiceErrorGenerator <HRCountryBorder> serviceError = new ServiceErrorGenerator <HRCountryBorder>(); return(serviceError.GenerateErrors(ex.Message)); } } else { //3- ServiceErrorGenerator <HRCountryBorder> serviceError = new ServiceErrorGenerator <HRCountryBorder>(); return(serviceError.GenerateErrors(HRCountriesServicesSolution.Constant.BOUNDARIES.BORDER_SERVICE_ERROR_DESCRIPTION)); } }
public async Task <HRRegion> Get(int id) { if (_regionsService != null) { //1- try { return(await _regionsService.GetRegionAsync(id)); } catch (Exception ex) { //2- ServiceErrorGenerator <HRRegion> serviceError = new ServiceErrorGenerator <HRRegion>(); return(serviceError.GenerateError(ex.Message)); } } else { //3- ServiceErrorGenerator <HRRegion> serviceError = new ServiceErrorGenerator <HRRegion>(); return(serviceError.GenerateError(HRCountriesServicesSolution.Constant.REGION.REGION_SERVICE_ERROR_DESCRIPTION)); } }