src/Shared/EntityFramework/Internal/LazyInternalConnection.cs
// <summary>
// Searches the app.config/web.config file for a connection that matches the given name.
// The connection might be a store connection or an EF connection.
// </summary>
// <param name="name"> The connection name. </param>
// <returns> True if a connection from the app.config file was found and used. </returns>
Searches the app.config/web.config file for a connection that matches the given name.
The connection might be a store connection or an EF connection.
Searches the app . config / web . config file for a connection that matches the given name . The connection might be a store connection or an EF connection .
private bool TryInitializeFromAppConfig(string name, AppConfig config)
        {
            DebugCheck.NotNull(config);
            var appConfigConnection = FindConnectionInConfig(name, config);
            if (appConfigConnection != null)
            {
                InitializeFromConnectionStringSetting(appConfigConnection);
                _connectionStringOrigin = DbConnectionStringOrigin.Configuration;
                _connectionStringName = appConfigConnection.Name;
                return true;
            }
            return false;
        }
private bool TryInitializeFromAppConfig ( string name , AppConfig config ) { DebugCheck . NotNull ( config ) ; var appConfigConnection = FindConnectionInConfig ( name , config ) ; if ( appConfigConnection != null ) { InitializeFromConnectionStringSetting ( appConfigConnection ) ; _connectionStringOrigin = DbConnectionStringOrigin . Configuration ; _connectionStringName = appConfigConnection . Name ; return true ; } return false ; }
Searches the app.config/web.config file for a connection that matches the given name.
Searches the app . config / web . config file for a connection that matches the given name .
True if a connection from the app.config file was found and used.
True if a connection from the app . config file was found and used .
name
string
The connection name.
The connection name .
config
AppConfig