Exemple #1
0
        public decimal CalculateFinalPriceAsyncTest(
            decimal DayMultiplier, decimal DayPrice,
            decimal KilometerMultiplier, decimal KilometerPrice,
            DateTime DateFrom, DateTime DateTo,
            decimal InitialMileage, decimal FinalMileage)
        {
            var model = new FinalPriceModel(
                new CarType {
                DayMultiplier = DayMultiplier, KilometerMultiplier = KilometerMultiplier
            },
                new Setting {
                DayPrice = DayPrice, KilometerPrice = KilometerPrice
            });

            model.DateFrom = DateFrom;
            model.DateTo   = DateTo;

            model.InitialMileage = InitialMileage;
            model.FinalMileage   = FinalMileage;

            return(model.CalculateFinalPriceAsync().Result);
        }
Exemple #2
0
 public async Task <decimal> GetFinalPrice([FromBody] FinalPriceModel model)
 {
     return(await model.CalculateFinalPriceAsync());
 }