如何克隆在NHibernate的对象?对象、NHibernate

由网友(赋词半阙)分享简介:如何实现NHibernate的对象(实体)的克隆?在实体类有属性,例如How to implement cloning of objects (entities) in NHibernate? In the classes of entities have properties suchpublic virtual...

如何实现NHibernate的对象(实体)的克隆?在实体类有属性,例如

How to implement cloning of objects (entities) in NHibernate? In the classes of entities have properties such

public virtual IList<Club> Clubs { get; set; }

所有的类是从BaseObject继承。 我试图实现使用XML序列化,但接口不序列化。

All classes are inherited from BaseObject. I tried to implement using xml serialization, but the interfaces are not serialized.

感谢您的解答!

推荐答案

AutoMapper HTTP://automapper.$c$cplex.com / 解决了我的问题。 克隆一个业务对象的示例:

AutoMapper http://automapper.codeplex.com/ resolves my question. Example of cloning a business object:

Mapper.CreateMap<Transaction, Transaction>();
var newtransact = new Transaction();
Mapper.Map(transact, newtransact);
阅读全文

相关推荐

最新文章