public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as RelatedEntryComponent;

                if (dest == null)
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }

                base.CopyTo(dest);
                if (RelationshipElement != null)
                {
                    dest.RelationshipElement = (Code <Hl7.Fhir.Model.CatalogEntry.CatalogEntryRelationType>)RelationshipElement.DeepCopy();
                }
                if (Target != null)
                {
                    dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy();
                }
                return(dest);
            }
Esempio n. 2
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as SpecimenSourceComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (RelationshipElement != null)
                    {
                        dest.RelationshipElement = (Code <Hl7.Fhir.Model.Specimen.HierarchicalRelationshipType>)RelationshipElement.DeepCopy();
                    }
                    if (Target != null)
                    {
                        dest.Target = new List <Hl7.Fhir.Model.ResourceReference>(Target.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }