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

[Solved] circular reference was detected while serializing an object

3 Answers 542 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Niels Schneider
Top achievements
Rank 1
Niels Schneider asked on 20 Feb 2010, 11:11 PM
I'm using EF4 as a datasource for the Grid. I'm using the POCO templates with the lazy loading functionaliteit enabled. When actions on the grid are defined:

 

columns.Command(commands =>

{

commands.Edit();

commands.Delete();

}).Width(180);

Then a exception will occur complaining about a circular reference. In my case a Customer has a reference to one of more invoices and an invoice has a ref back to customer.

Problem occurs with serializing the data with the standard javascriptSerializer from the .Net framework which cannot handle this.

Has anyone a solution for this problem.

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 22 Feb 2010, 08:36 AM
Hi Niels Schneider,

The problem and a few solutions are described in this blog post. You can check it out.

All the best,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
P
Top achievements
Rank 1
answered on 22 Feb 2010, 12:27 PM
Hi,
When I removed problem in serializing my entity Customer (EF), I am getting new one:

A circular reference was detected while serializing an object of type 'System.Data.Metadata.Edm.AssociationType'.


Any ideas?

--
ASP .NET MVC 2 rc2
Telerik.Web.Mvc.dll (2010.1.218.235)
0
Niels Schneider
Top achievements
Rank 1
answered on 23 Feb 2010, 01:55 PM
Hi Atanas and P,

Thank you for the response. Described solutions work, but cannot be used in my situation. Shall look into this at a later time.

Niels.
Tags
Grid
Asked by
Niels Schneider
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
P
Top achievements
Rank 1
Niels Schneider
Top achievements
Rank 1
Share this question
or