src/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs
/// <summary>
///     Add a connection string object to the hash and push the updates directly to the .config file
/// </summary>
Add a connection string object to the hash and push the updates directly to the .config file
Add a connection string object to the hash and push the updates directly to the . config file
private void AddConnectionString(Project project, string entityContainerName, ConnectionString connStringObj)
        {
            if (null == project)
            {
                throw new ArgumentNullException("project");
            }
            lock (_hashSyncRoot)
            {
                ExtractConnStringsIntoHash(project, true);
                if (!ConnStringsByProjectHash.ContainsKey(project))
                {
                    ConnStringsByProjectHash[project] = new Dictionary<string, ConnectionString>();
                }
                if (ConnStringsByProjectHash[project].ContainsKey(entityContainerName))
                {
                    ConnStringsByProjectHash[project].Remove(entityContainerName);
                }
                ConnStringsByProjectHash[project].Add(entityContainerName, connStringObj);
                InsertConnStringsFromHash(project);
            }
        }
private void AddConnectionString ( Project project , string entityContainerName , ConnectionString connStringObj ) { if ( null == project ) { throw new ArgumentNullException ( " " ) ; } lock ( _hashSyncRoot ) { ExtractConnStringsIntoHash ( project , true ) ; if ( ! ConnStringsByProjectHash . ContainsKey ( project ) ) { ConnStringsByProjectHash [ project ] = new Dictionary < string , ConnectionString > ( ) ; } if ( ConnStringsByProjectHash [ project ] . ContainsKey ( entityContainerName ) ) { ConnStringsByProjectHash [ project ] . Remove ( entityContainerName ) ; } ConnStringsByProjectHash [ project ] . Add ( entityContainerName , connStringObj ) ; InsertConnStringsFromHash ( project ) ; } }
Add a connection string object to the hash and push the updates directly to the .config file
Add a connection string object to the hash and push the updates directly to the . config file
// bug 556587: we need to delete the connection string from the hash if it is stale
project
Project
entityContainerName
string
connStringObj
ConnectionString