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); }
public async Task <decimal> GetFinalPrice([FromBody] FinalPriceModel model) { return(await model.CalculateFinalPriceAsync()); }