This is a migrated thread and some comments may be shown as answers.

WCF Services + Relationship (StackOverflowException)

1 Answer 49 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nélisson
Top achievements
Rank 1
Nélisson asked on 03 Sep 2012, 11:58 PM
Hi, 

I've a 1-to-many relationship between A and B tabble, A contains a Property Be that get B associated, and B contains As property that get a Collection<A>.

I used the "OpenAccess Service" Wizard to create a WCF plain service, but in client when access a NavigationProperty from a Collection, return null.

Reading this http://www.telerik.com/help/openaccess-orm/developer-guide-wcfservices-plain-service-handle-relationships.html I can get the A.Be return B, but B.As return null;

overrriding Assemble for B-class in Assemble.cs, and adding AssembleNavigational to   Bdto BAssemble(B), causes a StackOverflowException, because B.AssembleCollections refer A.Assemble and A.Assemble refer B.Assemble.

It's a loop!!!

Sorry for english

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 06 Sep 2012, 02:57 PM
Hello NĂ©lisson,

You could find this article useful. It demonstrates how to achieve this goal.

Hope that helps.


Regards,
Damyan Bogoev
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
Development (API, general questions)
Asked by
Nélisson
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or