Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        private static FourteenDayValuesDomainModel GetFourteenDayValuesDomainModelFromOneCallApiDataModel(OpenWeatherOneCallApiDataModel model)
        {
            IMapperFourteenDayValuesDomainModel mapper = new MapperOpenWeatherOneCallToFourteenDayValuesDomainModel();

            return(mapper.MapToFourteenDayValuesDomainModel(model));
        }
Ejemplo n.º 5
0
        private static ThreeDayValuesDomainModel GetThreeDayValuesDomainModelFromOneCallApiDataModel(OpenWeatherOneCallApiDataModel model)
        {
            IMapperThreeDayValuesDomainModel mapper = new MapperOpenWeatherOneCallToThreeDayValuesDomainModel();

            return(mapper.MapToThreeDayValuesDomainModel(model));
        }
Ejemplo n.º 6
0
        private static HourlyValuesDomainModel GetHourlyValuesDomainModelFromOneCallApiDataModel(OpenWeatherOneCallApiDataModel model)
        {
            IMapperHourlyValuesDomainModel mapper = new MapperOpenWeatherOneCallToHourlyValuesDomainModel();

            return(mapper.MapToHourlyValuesDomainModel(model));
        }