public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as EntityComponent; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (RoleElement != null) { dest.RoleElement = (Code <Hl7.Fhir.Model.Provenance.ProvenanceEntityRole>)RoleElement.DeepCopy(); } if (What != null) { dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopy(); } if (Agent != null) { dest.Agent = new List <Hl7.Fhir.Model.Provenance.AgentComponent>(Agent.DeepCopy()); } return(dest); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as EntityComponent; if (dest != null) { base.CopyTo(dest); if (RoleElement != null) { dest.RoleElement = (Code <Hl7.Fhir.Model.Provenance.ProvenanceEntityRole>)RoleElement.DeepCopy(); } if (Type != null) { dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); } if (ReferenceElement != null) { dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); } if (DisplayElement != null) { dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); } if (Agent != null) { dest.Agent = (Hl7.Fhir.Model.Provenance.AgentComponent)Agent.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }