如何在NHibernate中实现对象(实体)的克隆?每个实体类都有这样的属性:
public virtual IList<Club> Clubs { get; set; }
另外,实体类继承了BaseObject。 我尝试使用 XML 序列化来实现解决方案,但无法序列化接口(interface)。
感谢您的回答!
最佳答案
AutoMapper http://automapper.codeplex.com/解决了我的问题。 例如,可以通过以下方式克隆业务对象:
Mapper.CreateMap<Transaction, Transaction>();
var newtransact = new Transaction();
Mapper.Map(transact, newtransact);
关于c# - 如何在 NHibernate 中克隆对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2427144/