[fluent-nhib] Re: Representing Reference by Reference Property and FK property in code

2009-10-27 Thread Hudson Akridge
> > So, to verify understanding, are you saying that the *Id* property is a > special case to this and does NOT load the entire myEntity.RelatedEntity ?? Yes, I'm pretty sure. I don't have a working example sitting in front of me doing that, but I believe I've verified that to be the case in the

[fluent-nhib] Re: Representing Reference by Reference Property and FK property in code

2009-10-27 Thread Mohamed Meligy
hmm.. forgive me being a newbie to NH as a whole, not just Fluent. My understanding of Lazy loading is that if i have an Entity myEntity, myEntity.RelatedEntity is NOT loaded by default, but when I do something like var relatedEntity = myEntity.RelatedEntity; or var someValueInRelatedEntity = myEn

[fluent-nhib] Re: Representing Reference by Reference Property and FK property in code

2009-10-27 Thread Hudson Akridge
If I'm not mistaken, just accessing the Id property of an entity that's lazy loaded, does not force a loading of that entity. The proxy has the Id on it, it's how it knows about which entity to go and get it whenever it's being lazy initialized. I could set up a simple test to verify though, but I

[fluent-nhib] Re: Representing Reference by Reference Property and FK property in code

2009-10-27 Thread Mohamed Meligy
Well, what if this is exactly what I want to avoid? What I want to avoid loading the entity (no need in my scenario most of the time I'll just be setting or reading only the key). Say ibn the UI for editing screen I have drop down menu with all OtherEntity objects and I want to just compare IDs to

[fluent-nhib] Re: Representing Reference by Reference Property and FK property in code

2009-10-27 Thread Hudson Akridge
Well, there's no need for the RelatedEntityId to also be a property in the Entity class. Because the RelatedEntity class should have it's own ID (say you call it RelatedEntityId as a property in that classes mapping). So you should be able to retrieve an Entity, and do Entity.RelatedEntity.RelatedE