Objects getting Circular Refernce Ajax/JSON

2 posts, 0 answers
  1. RABIE
    RABIE avatar
    2 posts
    Member since:
    Jul 2013

    Posted 30 Aug 2013 Link to this post

    I created a project MAPPING with OpenAccess ORM
    I have a object1 which contains a list of another object2, my problem is that when I want to transefer my object1 to a view with ajax / json it does not work.

    I think it is a problem of circular reference

    is there a way to fix it?


    Example: Site has a one-to-many relationship with forecast.
    So if I'm in Site, i can list the predictions (site.allforecast)...

    can you help me ?

  2. Alexander
    Alexander avatar
    727 posts

    Posted 04 Sep 2013 Link to this post

    Hi Rabie,

    As you have noticed, by default OpenAccess creates bidirectional associations - you have a reference on one side and a collection on the other side. This indeed could lead to serialization problems.

    The easiest way to verify if this is the problem is to disable one of the navigational properties and leave either only the reference or the opposite collection - just decide which one is more useful to you. This can be done by double-clicking the association in the designer and unchecking the checkbox for one of the navigational members. You could take a look at this article for reference how to use the editor.
    Hope that helps.

    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
Back to Top