Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }