How to remove circular reference in Entity Framework?

.net, entity-framework, orm

Solution

When I need to serialize, I generally project onto other types. This eliminates circular references, plus other data I don't want serialize. For example:

var q = (from c in Repository.Customers()
         where c.Id == id
         select new 
         {
             Name = c.Name,
             Orders = from o in C.Orders
                      select new
                      {
                          Date = o.Date
                      }
         }).First();
return Json(q);

Problem

The circular reference between my Customer and Order entities caused a exception during serialization. Is there any way to force EF to generate one-direction reference between these two entities? Thanks in advance!

Original source