0

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>
Bilgehan
  • 1,135
  • 1
  • 14
  • 41

1 Answers1

1

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>
DavidG
  • 113,891
  • 12
  • 217
  • 223