Reputation: 77
When I was trying to send the JSON object to the jQuery, I return the whole query result , then I get an error saying " A circular reference was detected while serializing an object of type 'aspnet_User'." However when I return parts of the table like
select new
{
n.CustomerID,
n.EndDate,
n.BeginDate
});
});
in this case I can see the values being retrieved. Please help me with the problem?
Upvotes: 0
Views: 137
Reputation: 5848
If you have a set of classes like
class User {
Account account;
}
class Account {
User user;
}
And you send them to a serializer, then then serializer will forever be in a loop. It will serialize User -> User's Account -> Account's User -> User's Account. The serializer detects this problem and throws and error. Instead if you have User with no account or Account with no user it shouldn't be a problem.
Upvotes: 2