I have this problem, I'm using Castle ActiveRecord and when I update I verify changes in the object in the OnFlushDirty event.
However, when I access to the previouState["MyProperty"], it turns to be null and I can't get the old value.
Do you know why?
this is the code;
protected override bool OnFlushDirty(object id, System.Collections.IDictionary previousState, System.Collections.IDictionary currentState, NHibernate.Type.IType[] types)
{
StringBuilder errors = new StringBuilder();
if (this._bankCode <= 0)
errors.Append("Bank code is invalid" + Environment.NewLine);
if (string.IsNullOrEmpty(this._name) || this._name.Trim().Length == 0)
errors.Append("Name is invalid" + Environment.NewLine);
//previousState["EnterpriseCode"] is always null
if (previousState["EnterpriseCode"] != currentState["EnterpriseCode"])
{
if (this._enterpriseCode == 0)
errors.Append("Enterprise code is invalid" + Environment.NewLine);
else
...