Thanks to @Charlieface, I found a solution. I can just use the existing constructor and make Random Crn
being readonly
.
public readonly object Clone()
{
Patient patient = new(_seed) {
PatientCovariates = this.PatientCovariates.ToDictionary(
entry => entry.Key,
entry => entry.Value.ToDictionary(
innerEntry => innerEntry.Key,
innerEntry => innerEntry.Value
)
)
};
return patient;
}