views:

118

answers:

1

I have the following DB structure (simplified version):

Comments - CommentId, UserId
Users - UserId
UserDetails - UserId, Address, Phone, etc.

I am using EF 4 with POCOs. The User property of the Comment class is marked as virtual (to enable lazy loading for it). However, I want when the User property is loaded (lazy) also its UserDetails property to be loaded (the relation Users - UserDetails is 1:1). Is that possible? Can I specify it in some way? I want to make lazy + eager loading in some way..

+1  A: 

No, you can't do that. You can, however, turn multiple tables into a single entity using the entity splitting technique. Sounds like that's what you're really after.

Craig Stuntz
Ahh - good pickup @Craig :) It's sorta like a view without having to make a view ....
Pure.Krome