sguidi wrote:
Pilotbob wrote:
Can you just make the properties read-only rather than relying on NHibernate for this?
Yes I could, however, for a class with many properties, it seems infeasible to have to place the attribute on all of the properties. It is a good short-term fix, but it would be nice if the mutable class attribute took care of this for you.
If that were the case your API would allow something (a property change) that wouldn't be persisted. I think your DomainModel should not rely on NHibernate to work properly. In addition by not making read-only properites in your logical object model read only in your real object model, even if NHibernate did enforce it on a Save() then you are moving a simple compile time error to a runtime error. Yuck.
BOb