I don't think NH exposes that directly, so doing it in your objects
(actually, your Entity base class if you have one) is probably best.
The closest you have is ISession.Contains, which tells you if the object is
associated (made persistent or retrieved) with a particular session,

    Diego


On Mon, Jul 26, 2010 at 08:19, alexey_baranov <[email protected]> wrote:

> Hi!
>
> I have ask my objects are they new very often. I have very simple
> method in parent class Obj
>
> public bool IsNew(){
>    return Id != null;
> }
>
> But it will be more correct to manage this ask to NHibernate I think.
> Does it have some method for this job like
>
> NH.IsObjectNew(myObj)
>
>
> thaks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

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

Reply via email to