How to implement objects (entities) cloning in NHibernate? Each entity class has such properties:
public virtual IList<Club> Clubs { get; set; }
Also, the entity class inherits BaseObject. I tried to implement the solution using XML serialization, but it's not possible to serialize interfaces.
Thank you for your answers!
AutoMapper http://automapper.codeplex.com/ solves my problem. For example, it's possible to clone a business object in the next way:
Mapper.CreateMap<Transaction, Transaction>();
var newtransact = new Transaction();
Mapper.Map(transact, newtransact);
Use DTOs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With