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; }