How to set update="false" now that SetAttribute has been removed?
I understand that SetAttribute has now been removed:
http://wiki.fluentnhibernate.org/Release_notes_1.0
I hope this doesn't mean that essential functionality has been taken away.
In our projects, we need to do this:-
.SetAttribute("update", "false");
How can I set the "update" attribute, without using SetAttribute?
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Stuart Childs on 13 Apr, 2010 07:22 PM
Use the
.Update()
(similarly,.Insert()
for insert="") method. Since.Update()
is setting a bool, you can use the.Not
property to set the next bool to false. So, putting it all together:Map(x => x.MyProperty).Not.Update();
The above will create a mapping like:
<property name="MyProperty" update="false" ...
Also note that there is a
.ReadOnly()
method which will set bothupdate="false"
andinsert="false"
3 Posted by tim_acheson on 14 Apr, 2010 08:23 AM
Thanks for confirming. :)
James Gregory resolved this discussion on 16 May, 2010 05:37 PM.