public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Provenance; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Target != null) { dest.Target = new List <Hl7.Fhir.Model.ResourceReference>(Target.DeepCopy()); } if (Occurred != null) { dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopy(); } if (RecordedElement != null) { dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); } if (PolicyElement != null) { dest.PolicyElement = new List <Hl7.Fhir.Model.FhirUri>(PolicyElement.DeepCopy()); } if (Location != null) { dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); } if (Reason != null) { dest.Reason = new List <Hl7.Fhir.Model.CodeableConcept>(Reason.DeepCopy()); } if (Activity != null) { dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); } if (Agent != null) { dest.Agent = new List <Hl7.Fhir.Model.Provenance.AgentComponent>(Agent.DeepCopy()); } if (Entity != null) { dest.Entity = new List <Hl7.Fhir.Model.Provenance.EntityComponent>(Entity.DeepCopy()); } if (Signature != null) { dest.Signature = new List <Hl7.Fhir.Model.Signature>(Signature.DeepCopy()); } return(dest); }