I keep getting an error when i delete an object from a collection that it will be resaved because it exists in other collections. In the current session only the collection I am working on exists. There aren't any others. So I think NHibernate is telling me that even though the object will be deleted, it still exists in the session.
How can i view the objects that are in the current session or in which collection did NHibernate find that the object that I am trying to delete belongs?
I found it:
var sessionContext = session.GetSessionImplementation().PersistenceContext;
foreach (var entity in sessionContext.EntitiesByKey.Values)
{
}
the context contains all the objects that are in the session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With