本文介绍了NHibernate:查找肮脏的收藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何查找脏属性使用NHibernate,但它似乎不适用于集合(即查找是否已向集合中添加或删除项目).有人知道吗?

I know how to find dirty properties using NHibernate, but it doesn't seem to work for collections (i.e. to find out if items have been added or removed from a collection).Anyone know how?

推荐答案

var ipc = theEntity.TheCollection as IPersistentCollection;
var isDirty = ipc.IsDirty;

但是,请记住这一点(来自XML文档):

However, keep this in mind (from the XML doc):

这篇关于NHibernate:查找肮脏的收藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 03:24