private Prosumer ProvideLPGProfile([NotNull] ProviderParameterDto parameters, [NotNull] Hausanschluss ha, [NotNull] Household household, [NotNull] CarDistanceEntry carDistanceEntry) { string prosumerName = household.Name; string sourceGuid = household.SourceGuid; string householdKey = household.HouseholdKey; long isn = household.FinalIsn; try { var prosumer = _lpgProfileLoader.LoadProsumer(parameters, ha, prosumerName, carDistanceEntry.HouseComponentType, LoadtypetoSearchFor, _saveableEntry, sourceGuid, householdKey, household.HouseGuid, isn, Services.RunningConfig); if (prosumer == null) { return(null); } if (prosumer.Profile == null) { throw new FlaException("Profile was null"); } parameters.HouseComponentResultObject.ActualDrivingDistance = prosumer.Profile.EnergySum() / 15.0 * 100; return(prosumer); } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception ex) { #pragma warning restore CA1031 // Do not catch general exception types Error(ex.Message); parameters.HouseComponentResultObject.ErrorMessage = ex.Message; } return(null); }
private Prosumer ProvideLPGProfile([NotNull] ProviderParameterDto parameters, [NotNull] Hausanschluss ha, [NotNull] Household household) { string prosumerName = household.Name; const HouseComponentType houseComponentType = HouseComponentType.Household; string sourceGuid = household.SourceGuid; string householdKey = household.HouseholdKey; long isn = household.FinalIsn; return(_lpgloader.LoadProsumer(parameters, ha, prosumerName, houseComponentType, LoadtypetoSearchFor, _saveableEntry, sourceGuid, householdKey, household.HouseGuid, isn, Services.RunningConfig)); }