Thanks for the replies.
I ended up doing this:
Code:
List<object> previous = new List<object>();
List<object> current = new List<object>();
List<string> properties = new List<string>();
// need to make strip out all the persistent objects
using (ISession session = this.sessionManager.OpenSession())
{
for (int index = 0; index < changes.Previous.Length; index++)
{
if (!session.Contains(changes.Previous[index]) && !session.Contains(changes.Current[index]) &&
!(changes.Previous[index] is IPersistentCollection) &&
!(changes.Current[index] is IPersistentCollection))
{
previous.Add(changes.Previous[index]);
current.Add(changes.Current[index]);
properties.Add(changes.Properties[index]);
}
}
}
Just checking to see if the object is in session. If it is then I just ignore it. Also ignore any objects that implement IPersistentCollection.
I imagine this will start breaking if I evict objects from session. Maybe it would be better to get the type of each object and check it against the mappings?