Пример #1
0
        private async Task <CarbonFootprintResult> CalculateFlightEmission(FlightOption flightOption, TimeOption timeOption)
        {
            var yearlyNumberOfFlights = ((double)flightOption.GetAverageValue() / timeOption.GetDays()) * TimeOption.year.GetDays();

            var response = await emissionClient.GetHotelEmission(yearlyNumberOfFlights);

            return(mapper.Map <CarbonFootprintResult>(response));
        }
Пример #2
0
        private async Task <CarbonFootprintResult> CalculatePaperEmmision(PaperOption paperOption, TimeOption timeOption)
        {
            var yearlyWeight = (paperOption.GetLbsWeight() / timeOption.GetDays()) * TimeOption.year.GetDays();

            var response = await emissionClient.GetPaperEmission(yearlyWeight);

            return(mapper.Map <CarbonFootprintResult>(response));
        }
Пример #3
0
        private async Task <CarbonFootprintResult> CalculateAccomodationEmmision(AccomodationOption accomodationOption, TimeOption timeOption)
        {
            var yearlyNumberOfDates = ((double)accomodationOption.GetAverageValue() / timeOption.GetDays()) * TimeOption.year.GetDays();

            var response = await emissionClient.GetHotelEmission(yearlyNumberOfDates);

            return(mapper.Map <CarbonFootprintResult>(response));
        }