public async Task <double> GetRiskValueAsync() { var model = new HomeshareEvent(); var value = await _service.GetRiskBase(model).ConfigureAwait(false); return(value); }
public async Task <bool> CheckIfInsurableAsync() { var valuables = new List <ItemOfValue> { new ItemOfValue { Kind = ItemType.Property, Value = 10 }, new ItemOfValue { Kind = ItemType.Vehicle, Value = 50 } }; var model = new HomeshareEvent { Valuables = valuables }; var activityRisk = await _service.GetRiskFromActivity(model).ConfigureAwait(false); var baseRisk = await _service.GetRiskBase(model).ConfigureAwait(false); var personalRisk = await _service.GetRiskFromOwner(model).ConfigureAwait(false); var valueRisk = await _service.GetRiskFromValuables(model).ConfigureAwait(false); var value = await _service.GetRiskCompounded(new List <double> { baseRisk, activityRisk, personalRisk, valueRisk }).ConfigureAwait(false); var isInsurable = model.IsInsurable(value.AsPercent()); return(isInsurable); }