title: Entity Framework - Keyword not supported: 'metadata'
body: <p>I have the following class:</p>
  
  <pre><code>public class EFRepository&lt;TContext&gt; : IDisposable where TContext : DbContext, IObjectContextAdapter, new()
  {
      private TContext context;
  
      public EFRepository(string connectionStringName)
      {
          context = new TContext();
          context.Database.Connection.ConnectionString =
              ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
      }
  }
  </code></pre>
  
  <p>with the following connection string:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="EntitiesConnection" connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=Bob-PC;initial catalog=Entities;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;
  
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Being called like this:</p>
  
  <pre><code>var Entities = new EFRepository&lt;EntitiesConnection&gt;("EntitiesConnection");
  </code></pre>
  
  <p>Which throws the error in the subject line.  I've seen the solutions using the EntityStringBuilder, however the Connection property is read only.  Any ideas on how to make this work?</p>
  
  <p>Thanks, </p>
  
  <p>Bob</p>