private IMetadataAttribute GetMetadataAttributeForRepotedAttribtue( IReportedAttribute reportedAttribute, IList<IMetadataAttribute> mAttributeBeans) { foreach (IMetadataAttribute currentMAttribtue in mAttributeBeans) { if (currentMAttribtue.Id.Equals(reportedAttribute.Id)) { return currentMAttribtue; } } throw new ReferenceException( "Can not find reference to metadata attribute with id " + reportedAttribute.Id); }
public ReportedAttributeObjectBaseCore( IMetadataAttribute correspondingMA, IReportedAttribute builtFrom, IIdentifiableRetrievalManager retrievalManager) : base(builtFrom) { this.reportedAttributes = new List<IReportedAttributeBase>(); this.builtFrom = builtFrom; concept = retrievalManager.GetIdentifiableObject<IConceptObject>( correspondingMA.ConceptRef, typeof(IConceptObject)); if (correspondingMA.HasCodedRepresentation()) { this.codelist = retrievalManager.GetIdentifiableObject<ICodelistObject>( correspondingMA.Representation.RepresentationRef, typeof(ICodelistObject)); } if (builtFrom.ReportedAttributes != null) { /* foreach */ foreach (IReportedAttribute reportedAttribute in builtFrom .ReportedAttributes) { IMetadataAttribute metadataAttribute = GetMetadataAttributeForRepotedAttribtue( reportedAttribute, correspondingMA.MetadataAttributes); reportedAttributes.Add(new ReportedAttributeObjectBaseCore(metadataAttribute, reportedAttribute, retrievalManager)); } } }