I think that you can set Update=False, then the data will be selected and
inserted, but not updated. with a readonly property and a factory method (or
constructor) for setting the value for new instances you're set.

On Thu, Mar 26, 2009 at 3:23 PM, Fabio Maulo <fabioma...@gmail.com> wrote:

> 2009/3/26 Peter Morris <mrpmor...@gmail.com>
>
>>
>>  This would work and is the kind of thing I would normally do, but in my
>> current ORM I can mark a property so that it can no longer be updated once
>> persisted so I can use this approach and still make Name immutible.  In NH
>> I
>> am trying to make my classes completely persistence ignorant so I need an
>> OOP way to make Name immutible, which is why I wanted to go for the Name
>> in
>> the constructor, although I suppose I could throw an exception if you try
>> to
>> set Name when it already has a value.
>
>
> You can configure NH to use the field (including the backfield of an
> autoproperty) and don't have the setter.
>
> --
> Fabio Maulo
>
>
> >
>


-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to