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

Objects getting Circular Refernce Ajax/JSON

1 Answer 7 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
RABIE
Top achievements
Rank 1
RABIE asked on 30 Aug 2013, 10:12 PM
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

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 ?
Thnks

Rabie

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 04 Sep 2013, 04:03 PM
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.

Regards,
Alexander
Telerik
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.
Tags
General Discussions
Asked by
RABIE
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or