title: Passing List of records with jQuery
body: <p>I've a situation where I want to pass list of records via Ajax/JQuery.</p>
  
  <pre><code>public JsonResult GetListOfRecords()
  {
     return Json(_repository.GetAllRecords());
  }
  </code></pre>
  
  <p>when I call this action method with jQuery, it doesn't work:</p>
  
  <pre><code>$.getJSON('GetAllRecords', function(data){ // data is IQueryable&lt;T&gt; or IEnumerabel&lt;T&gt;
  $.each(data, function(d) {
      $('#somewhere').html(d.Title); //d is SomeModelType and Title is property of that type
  });
  });
  </code></pre>
  
  <p>Note: GetAllRecords method returns <strong>IQueryable</strong>.... I also tested <strong>IEnumerable</strong></p>
  
  <p>However, if pass <strong>ArrayList</strong> type, it seems to be work (but not fulfill my need):</p>
  
  <pre><code>public JsonResult GetAllRecords()
  {
    var list = new ArrayList();
    foreach(var item in _repository.GetAllRecords())
    {
      list.Add(item.Title);
    }
    return Json(list);
  }
  </code></pre>
  
  <p>it just displays title...</p>
  
  <p>My Question is that "I want to pass <strong>IQueryable</strong> or <strong>IEnumerable</strong> through ajax."</p>