CodeList GetCodeList(StructureMessage message, TempCodelistRef v) { var codelist = message.FindCodeList(v.Id, v.AgencyId, v.Version); if (codelist == null || codelist.Count() == 0) { SignalError("Codelist not found: id='{0}',agencyId='{1}',version='{2}'. Codelists thar are referenced by a key family must exist in the same file of the key family.", v.Id, v.AgencyId, v.Version); return(null); } if (codelist.Count() > 1) { SignalError("Duplicate codelist found: id='{0}',agencyId='{1}',version='{2}'. Codelists thar are referenced by a key family must exist in the same file of the key family.", v.Id, v.AgencyId, v.Version); return(codelist.First()); } return(codelist.Single()); }