I am attempting to use the OnFlushDirty
method of a Castle.ActiveRecord
object in order to implement generic auditing of changes:
protected override bool OnFlushDirty(object id,
IDictionary previousState,
IDictionary currentState,
NHibernate.Type.IType[] types
)
On execution, OnFlushDirty is passed a Castle.ActiveRecord.Framework.DictionaryAdapter
for each of the previousState
and currentState
parameters.
Unfortunately DictionaryAdapter
does not support the GetEnumerator()
method, throwing a NotSupportedException
.
- Should I be expecting a
DictionaryAdapter
to be passed into OnFlushDirty in the first place?; and - Assuming I should, how can I enumerate through the Key/Value pairs within the
DictionaryAdapter
in order to compare previous and current states for auditing?