views:

62

answers:

1

I'm just getting my feet wet with .Net and Linq-to-Sql, so please bear with me. I've got three tables: User, AccountDetails and UserProfile. User is the parent to both AccountDetails and UserProfile, and the relationships are all 1 to 1. When I get a User object, I get the AccountDetail and UserProfile properties as expected. However, within the AccountDetail property/object, it recurses back to the User object which of course continues on until it reaches some recursion limit and stops. So, basically my object looks like this;

User

--AccountDetail

----User

------AccountDetail

--------User

----------AccountDetail

--UserProfile

----User

------UserProfile

--------User

----------UserProfile

Is there any way to stop this behavior? I've toyed with the Child Property setting on the Association but setting it to false only causes the User object to be produced without the AccountDetail and UserProfile.

A: 

There is no recursion involved, they are just object references. Show us the code that is causing problems.

klausbyskov