public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as EnrollmentRequest; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.FinancialResourceStatusCodes>)StatusElement.DeepCopy(); } if (CreatedElement != null) { dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); } if (Insurer != null) { dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); } if (Provider != null) { dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); } if (Candidate != null) { dest.Candidate = (Hl7.Fhir.Model.ResourceReference)Candidate.DeepCopy(); } if (Coverage != null) { dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); } return(dest); }