Nhibernate:获取真实实体类而不是代理类 [英] Nhibernate: Get real entity class instead of proxied class

查看:55
本文介绍了Nhibernate:获取真实实体类而不是代理类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让nhibernate返回我的类而不是它的代理类?我不介意它不是很懒或者不能更新.

Is there a way to make nhibernate return my class instead of its proxy class? I dont mind if it's not lazy or cant be updated.

推荐答案

您可以使用此代码取消代理

You can unproxy class with this code

session.PersistenceContext.Unproxy(proxiedInstance)

这篇关于Nhibernate:获取真实实体类而不是代理类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆