I think you ment .Load<T> as I would expect your code to work but when using
Load<T> it would not.

On Tue, Jun 28, 2011 at 2:11 PM, Jason Meckley <[email protected]>wrote:

> you mentioned a session closed error. are you trying to access the value
> like
>
> using(var session = factory.OpenSession())
> {
>    var entity = session.Get<Entity>(id);
>    return entity.Parent.Id;
> }
> or
> using(var session = factory.OpenSession())
> {
>    var entity = session.Get<Entity>(id);
> }
> return entity.Parent.Id;
>
> the first approach will work, then second would not. the scope of the
> session matters.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nhusers/-/J4bYf3brY1UJ.
>
> 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.
>



-- 
Ramon

-- 
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