Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当只知道数据库主键/ID 时,有没有办法检查实体是否已在 NHB 的缓存中准备好(未启用二级缓存),而不会像使用 Get 那样访问数据库?
简而言之:
_session.ExistsInCache()
亲切的问候
这是一种方式...
var exists = NHibernateUtil.IsInitialized(Session.Load<YourClass>(id));