0

我想划分我的 web.config ,可以使用 httphandler 或 appsettings 等使用 configSource 属性划分某些部分。我还想将实体框架设置分开到不同的 config.file 。这可能吗?

<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>
4

1 回答 1

1

是的,只需执行与 相同的操作httpHandlers,例如:

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

ConfigurationFiles\Settings\EntityFramework.config文件中:

<entityFramework>
    <!-- etc..... -->
</entityFramework>
于 2018-09-17T11:28:58.213 回答