Put EntityFramework Settings to another config file

50 Views Asked by At

I want to divide my web.config ,Some sections can be divided with use configSource attribute like httphandler or appsettings.I want to also separate entity framework settings to different config.file.Is this possible?

<httpHandlers configSource="ConfigurationFiles\Settings\Web.HttpHandlers.config" />

>  <entityFramework>
>     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory,
> EntityFramework">
>       <parameters>
>         <parameter value="v11.0" />
>       </parameters>
>     </defaultConnectionFactory>
>     <providers>
>       <provider  invariantName="Oracle.DataAccess.Client" type="Oracle.DataAccess.EntityFramework.EFOracleProviderServices,
> Oracle.DataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral,
> PublicKeyToken=89b483f429c47342" />
>       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices,
> EntityFramework.SqlServer" />
>     </providers>   </entityFramework>
1

There are 1 best solutions below

0
On BEST ANSWER

Yes, just do the same as you have done for httpHandlers, for example:

<entityFramework configSource="ConfigurationFiles\Settings\EntityFramework.config" />

And in the ConfigurationFiles\Settings\EntityFramework.config file:

<entityFramework>
    <!-- etc..... -->
</entityFramework>