I am trying to return a fully deep object (with all foreign key relationships) JSON, but I get zeros 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 { get; set; } public Diagnosis PrimaryDiagnosis { get; set; } public OrderApprovalStatus ApprovalStatus { get; set; } public User Approver { get; set; } public User Submitter { get; set; } public DateTime ApprovalDate { get; set; } public DateTime SubmittedDate { get; set; } public Boolean IsDeprecated { get; set; } }
I have not yet found a good resource for using EF 4.1 annotations. If you could offer a good, that is, an answer, you could give me a link, and that would be enough for an answer!
Hello,
Guido
Update
I added a virtual keyword according to Saxman, and now I am dealing with a circular link error.
Guido Anselmi Apr 07 '11 at 17:50 2011-04-07 17:50
source share