title: Return Entity Framework Objects as JSON
body: <p>I try to return Entity Framework Objects as Json with the following method in my Controller:</p>
  
  <pre><code>  public JsonResult EventList() {
          var results = from s in db.Events
                        select new
                        {
                            OrderID = s.EventID,
                            OrderTitle =s.EventType,
                            OrderDate = s.Title
                        };
  
  return Json(results);
  }
  </code></pre>
  
  <p>I get a server error 500 when entering the page /events/EventList/. Also a Jquery get request returns no data. What is the correct way to return the results in Json format?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>This seems to work. But I need results from the database.</p>
  
  <pre><code>   public ActionResult EventList() {
  
          Event test = new Event
          {
              EventID = 1,
              Title = "test",
              Description = "test"
          };
  
          return Json(new { event = test }, JsonRequestBehavior.AllowGet);
      }
  </code></pre>