I'm moving a project from SubSonic to NHibernate and am using Fluent NHibernate to perform all of our mapping. Our db schema is pretty straight forward and most of our cases appear thus far to be well illustrated by different blog posts and sample code that's available.
One thing that I'm unable to figure out however is the ability to Map a column so that its value is only allowed to be set on the initial INSERT of the data. It's a generated value on our app tier, and once inserted, we don't want to allow it to be updated any further.
I tried the obvious (but wrong)
Map(x => Foo).ReadOnly()
What would be the appropriate function chain to accomplish what I'm after?
After much experimentation--
Map(u => Foo).Not.Update();
Appears to be doing what I desire--but I'd love if more experienced hands chimed in to confirm that my interpretation of the results is accurate. i'd hate to mark this as the answer and inadvertently send future visitors down the wrong path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With