public static CountryDataFilter ConvertToDbValue(CountryFilter tourFilter) { CountryDataFilter result = new CountryDataFilter { Skip = tourFilter.Skip, Take = tourFilter.Take, TourType = tourFilter.TourType.HasValue ? TourTypesEnumConverter.ConvertToDbValue(tourFilter.TourType.Value) : null }; return(result); }
public ICountry GetCountry(TourTypesEnum tourType, string countryUrl) { var tourTypeData = TourTypesEnumConverter.ConvertToDbValue(tourType); var countryDataModel = _countryDataManager.GetCountry(tourTypeData, countryUrl); if (countryDataModel == null) { throw new CountryNotFoundException(); } var country = new CountryModel(countryDataModel, _countryDataManager); return(country); }
public ITour GetTour(TourTypesEnum tourType, string countryUrl, string tourUrl) { var tourTypeData = TourTypesEnumConverter.ConvertToDbValue(tourType); var tourDataModel = _tourDataManager.GetTour(tourTypeData, countryUrl, tourUrl); if (tourDataModel == null) { throw new TourNotFoundException(); } var tour = new TourModel(tourDataModel, _tourDataManager, _imageDataManager); return(tour); }