title: Entity Framework: ObjectContext.ExecuteStoreQuery produces detached objects
body: <p>I need to run some custom SQL to return a list of objects from a table. I'm using ExecuteStoreQuery for that.</p>
  
  <pre><code>var q = context.ExecuteStoreQuery&lt;ProductionUnit&gt;(MySelectString, new SqlParameter("@ProductionUnitId", value));
  </code></pre>
  
  <p>This does result in q containing an ObjectResult collection, but the actual ProductionUnit elements are Detached and their EntityKey is null. This creates a number of issues when trying to work on some of these objects or their relationships. My SQL query returns a result set containing all the columns of the respective ProductionUnits table (and nothing more).</p>
  
  <p>Anything else I need to do in order to have these objects tracked or is this behavior by design?</p>