title: Bring back DbContext.Detach() method with an extension method (EF5)
body: <p>There is no <code>Detach(object entity)</code> on the <code>DbContext</code> in Entity Framework 5.</p>
  
  <p>To detach an entity, the state now needs to be changed.  Maybe I am missing something, but this seems much less intuitive and readable than using the <code>Detach</code> method:</p>
  
  <pre><code>context.Entry(myEntity).State = EntityState.Detached;
  </code></pre>
  
  <p>I am tempted to just create an extension method to bring back the Detach method:</p>
  
  <pre><code>public static void Detach(this MyEntities context, object entity)
  {
      context.Entry(entity).State = EntityState.Detached;
  }
  </code></pre>
  
  <p><strong>What is the reason why Microsoft removed the DbContext.Detach() method in EF 5?</strong></p>