Exemple #1
0
        public ThreeDayValuesDomainModel MapToThreeDayValuesDomainModel(OpenWeatherOneCallApiDataModel model)
        {
            ThreeDayValuesDomainModel domainmodel = new ThreeDayValuesDomainModel();

            domainmodel.ThreeDayValues = new List <ThreeDayDomainModel>();
            for (int i = 0; i < 3; i++)
            {
                domainmodel.ThreeDayValues.Add(MapToThreeDayValueDomainModel(model.Daily[i]));
            }

            return(domainmodel);
        }
        public HourlyValuesDomainModel MapToHourlyValuesDomainModel(OpenWeatherOneCallApiDataModel model)
        {
            HourlyValuesDomainModel domainModel = new HourlyValuesDomainModel();

            domainModel.HourlyValues = new List <HourlyDomainModel>();
            foreach (var hourly in model.Hourly)
            {
                domainModel.HourlyValues.Add(MapToHourlyValueDomainModel(hourly));
            }

            return(domainModel);
        }
Exemple #3
0
        public FourteenDayValuesDomainModel MapToFourteenDayValuesDomainModel(OpenWeatherOneCallApiDataModel model)
        {
            FourteenDayValuesDomainModel domainmodel = new FourteenDayValuesDomainModel();

            domainmodel.FourteenDayValues = new List <FourteenDayDomainModel>();
            for (int i = 0; i < 7; i++)
            {
                domainmodel.FourteenDayValues.Add(MapToFourteenDayValueDomainModel(model.Daily[i]));
            }
            for (int noDataIndex = 7; noDataIndex < 14; noDataIndex++)
            {
                domainmodel.FourteenDayValues.Add(CreateEmptyDomainModel());
            }

            return(domainmodel);
        }
        private static FourteenDayValuesDomainModel GetFourteenDayValuesDomainModelFromOneCallApiDataModel(OpenWeatherOneCallApiDataModel model)
        {
            IMapperFourteenDayValuesDomainModel mapper = new MapperOpenWeatherOneCallToFourteenDayValuesDomainModel();

            return(mapper.MapToFourteenDayValuesDomainModel(model));
        }
        private static ThreeDayValuesDomainModel GetThreeDayValuesDomainModelFromOneCallApiDataModel(OpenWeatherOneCallApiDataModel model)
        {
            IMapperThreeDayValuesDomainModel mapper = new MapperOpenWeatherOneCallToThreeDayValuesDomainModel();

            return(mapper.MapToThreeDayValuesDomainModel(model));
        }
        private static HourlyValuesDomainModel GetHourlyValuesDomainModelFromOneCallApiDataModel(OpenWeatherOneCallApiDataModel model)
        {
            IMapperHourlyValuesDomainModel mapper = new MapperOpenWeatherOneCallToHourlyValuesDomainModel();

            return(mapper.MapToHourlyValuesDomainModel(model));
        }