public List<TarificationOption> DeriveDataForView(TarificationModel inputData, List<FirmInstitutionOptionValue> lstFirmInstitutionOptionValues) { List<TarificationOption> retVal = new List<TarificationOption>(); foreach (Option opt in inputData.Option) { //Set default values : values from FirmInstitution Tarification TarificationOption optModel = new TarificationOption(opt); int idOptionFirmEquivalent = inputData.GetDefaultId(opt.idOption); var optFirmValue = lstFirmInstitutionOptionValues.Where(ov => ov.idOption.Equals(idOptionFirmEquivalent)); if (optFirmValue != null) { optModel.IsSelected = optFirmValue.Count() > 0; } retVal.Add(optModel); } return retVal; }
public List<TarificationOption> DeriveDataForView(TarificationModel inputData) { List<TarificationOption> retVal = new List<TarificationOption>(); foreach (Option opt in inputData.Option) { TarificationOption optModel = new TarificationOption(opt); var optValue = inputData.OptionValue.Where(ov => ov.idOption.Equals(optModel.Option.idOption)); if (optValue != null) { optModel.IsSelected = optValue.Count() > 0; } retVal.Add(optModel); } return retVal; }