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.
NHibernate_reference.pdf,第 26 页:
请注意,每次更新对象的持久状态时都不会调用 ILifecycle.OnUpdate()。仅当将瞬态对象传递给 ISession.Update() 时才调用它。
为什么它设计链接呢?
您应该改用 IInterceptor
ILifecycle 已弃用;正如 James L 所写,您应该改用 IInterceptor 实现。我对您引用的文档的解释是 OnUpdated 事件仅从 Update 方法中触发。也就是说,该事件旨在通知订阅者 Update 方法已被调用,仅此而已。