public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as AnimalComponent; if (dest != null) { base.CopyTo(dest); if (Species != null) { dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopy(); } if (Breed != null) { dest.Breed = (Hl7.Fhir.Model.CodeableConcept)Breed.DeepCopy(); } if (GenderStatus != null) { dest.GenderStatus = (Hl7.Fhir.Model.CodeableConcept)GenderStatus.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }