Entity Framework app.config settings. The default factory and value= with EF6.0

entity-framework

Question

<entityFramework>
   <defaultConnectionFactory 
       type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
         <parameter value="v11.0" />           
      </parameters>
   </defaultConnectionFactory>
</entityFramework>

EDIT: QUESTION was reworded/reworked.

What does <parameter value="v11.0"> mean ? Or better Said Why Have just a Db Value? What about using a full Data Source ? And what is LocalDbConnectionFactory implying

These defaults are hard for me to understand.

Using the Sql default connection factory and parameter used SQL server LocalDbConnectionFactory did not work.

This did work:

<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="Data Source=localhost; Integrated Security=True; MultipleActiveResultSets=True" />
1
8
11/3/2015 12:19:29 AM

Accepted Answer

The configuration section allows you to specify a default connection factory that Code First should use to locate a database to use for a context. The default connection factory is only used when no connection string has been added to the configuration file for a context.

The following configuration will cause Code First to use a LocalDB instance for contexts that don’t have an explicit connection string set.

<entityFramework>
  <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
    <parameters>
      <parameter value="v11.0" />
    </parameters>
  </defaultConnectionFactory>
</entityFramework>

Update : v11.0 is version of the LocalDb.

more info.

27
1/25/2016 10:34:50 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow