WCF Services + Relationship (StackOverflowException)

Thread is closed for posting
2 posts, 0 answers
  1. Nélisson
    Nélisson avatar
    1 posts
    Member since:
    Aug 2012

    Posted 03 Sep 2012 Link to this post


    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
  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 06 Sep 2012 Link to this post

    Hello Nélisson,

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

    Hope that helps.

    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!
Back to Top