Linq to SQL and Serialization: A circular reference was detected while serializing an object of type [whatever] (via No Free Time)

Saves my day today when I’m working on a web service that returns a List of System.Data.Linq.Table

Linq to SQL and Serialization : A circular reference was detected while serializing an object of type [whatever] Okay so I created a Linq to SQL model today. It includes tables for Blog Posts and Blog Comments which have a one-to-many relationship, hence a BlogComment has a .BlogPost property and a BlogPost has a .BlogComments property. Pretty standard. When I attempted to serialize a collection of BlogPosts and their related BlogComments I was met with the following error: A circular reference was detected while serializing an object of type BlogPost. Fair … Read More

via No Free Time

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s