开发者

NHibernate dehydration

开发者_C百科Is there a way with NHibernate to take an instance of some mapped type and dehydrate it to an object[] that corresponds to the columns of the database if this instance were to be persisted in the database?


it would be helpful to know your use case. Maybe there is a better way to solve it but here goes what you requested:

var persistor = session.GetSessionImplementation().GetEntityPersister(obj.GetType().Name, obj);
object[] values = persistor.GetPropertyValues(obj, NHibernate.EntityMode.Poco);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜