I have a class named Body; it has a property named Items, which is a set of BodyItem.
When I try to persist an instance of Body which has only one BodyItem in Body.Items, everything works, and audit data is also recorded. But when I add two different items to Body.Items and try to persist it, an exception is throwed:
NHibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: System.Collections.Generic.Dictionary`2[System.String,System.Object], of entity: ttbl_items_log
If I mark Body.Items with [NotAudited], then I can persist data normally, but (obviously) the audit data for the items is not recorded.
I have a class named Body; it has a property named Items, which is a set of BodyItem.
When I try to persist an instance of Body which has only one BodyItem in Body.Items, everything works, and audit data is also recorded. But when I add two different items to Body.Items and try to persist it, an exception is throwed:
NHibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: System.Collections.Generic.Dictionary`2[System.String,System.Object], of entity: ttbl_items_log
If I mark Body.Items with [NotAudited], then I can persist data normally, but (obviously) the audit data for the items is not recorded.