title: How to iterate through, and update each element of an IEnumerable
body: <p>I have an IEnumerable object that has been populated by an SqlQuery call and I want to iterarate through it and update its type class members.</p>
  
  <p>My example code:</p>
  
  <pre><code>public class MyClass
  {
      public string id { get; set; }
      public string data { get; set; }
  }
  
  ...
  
  public JsonResult GetMyClass(...)
  {
      IEnumerable&lt;MyClass&gt; oMyClass = db.Database.SqlQuery&lt;MyClass&gt;("SELECT ...");
  
      // Here I want to iterate through the oMyClass object updating
      // the "data" member before returning it as a Json
  
      return Json(oMyClass, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>There doesn't seem to be a nice way of doing this, expecially if one also want to update the object and not just reading from it.</p>