How to Get Full Object with Code First Entity Framework 4.1
问题 I am trying to return as JSON the fully deep object (with all of the foreign key relationships filled in) but I am getting nulls for all the referenced objects. Here is the call to get the object: public ActionResult GetAll() { return Json(ppEFContext.Orders, JsonRequestBehavior.AllowGet); } And here is the Order object itself: public class Order { public int Id { get; set; } public Patient Patient { get; set; } public CertificationPeriod CertificationPeriod { get; set; } public Agency Agency