I have a model with a Dictionary<string, string>
property that is stored in the database using JSON. I am using a custom NHibernate type to map the dictionary to and from a JSON-encoded string, which works fine.
My problem is that when I flush the session, and the only property that has changed is this dictionary, then the entity is not updated. If any other property has also changed, then the entity (including the JSON string) is updated.
In other words, NHibernate correctly maps the dictionary to JSON using my custom type, but this custom property is NOT used to determine if the entity has changed.
Suggestions?