2

I've been trying to implement POCO over WCF (using Entity Framework 4.0) - just like this - http://devblog.petrellyn.com/?p=278

I have many cases of

Object A - refs list of Object B

For each Object B - refs Object A

I've debugged this and the reference goes on forever, i.e.

User "joe" has a collection of Teams. Team[0] has a reference to User "joe". User "joe" has a collection of Teams. Team[0] has a reference to User "joe".

And so on. Nothing special here I would think. Although I'm wondering if this is where my problem is?

However after adding the much blogged CyclicReferencesAware attribute I get a new Stack Overflow exception. So this still looks like it's not really sorted out the cyclic dependencies.

Running out of ideas now - anyone got any pointers?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Duncan
  • 10,218
  • 14
  • 64
  • 96

1 Answers1

1

Seems I could have wasted a full day over nothing!

The cyclic attribute does indeed work, BUT NOT WITH THE WCF TEST CLIENT!

WcfTestClient.exe not able to handle circular reference?

Will leave answer here as sure to help someone else in future.

Community
  • 1
  • 1
Duncan
  • 10,218
  • 14
  • 64
  • 96