jbara jihed

jbara jihed

  • NA
  • 59
  • 446

How I Can duplicate a complex object with all param/subclas

Jan 3 2020 2:58 AM
i'm using Asp.net With Nhibernate 
I want to duplicate complex object with all references  
 
This is the Model:
public class X : AuditableVersionPersistentObject<long,int>{  
private ISet<Clause.Clause> _clauses = new HashSet<Clause.Clause>();
private ISet<DocumentLink> _documentLinks = new HashSet<DocumentLink>();
private long? _EtudiantNumber;
private ApplicationUser _applicationUser;
private Offer _Offer;
private Person.Person _etudiantHolder;
private Person.Person _etudiantPayer;
... }
 
This Is the Function copy :
public virtual Etudiant CopyEtudiant()
{
Etudiant etudiant= new Etudiant (0, 0);
 
etudiant.EtudiantNumber= EtudiantNumber;
....