src/Misc/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs
// <summary>
//     Returns an EntityContainer name unique in the app/web.config for the given project
//     given a proposed EntityContainer name
// </summary>
Returns an EntityContainer name unique in the app/web.config for the given project
given a proposed EntityContainer name
Returns an EntityContainer name unique in the app / web . config for the given project given a proposed EntityContainer name
internal string ConstructUniqueEntityContainerName(string proposedEntityContainerName, Project project)
        {
            Debug.Assert(null != project, "project in ConstructUniqueEntityContainerName()");
            Debug.Assert(
                null != proposedEntityContainerName, "Null proposedEntityContainerName in ConstructUniqueEntityContainerName()");
            var entityContainerName = proposedEntityContainerName;
            var suffix = 1;
            InitializeConnectionStringsHash();
            Dictionary<string, ConnectionString> connStringsInProject;
            if (null != ConnStringsByProjectHash
                && ConnStringsByProjectHash.TryGetValue(project, out connStringsInProject))
            {
                while (connStringsInProject.ContainsKey(entityContainerName))
                {
                    entityContainerName = proposedEntityContainerName + suffix;
                    ++suffix;
                }
            }
            return entityContainerName;
        }
internal string ConstructUniqueEntityContainerName ( string proposedEntityContainerName , Project project ) { Debug . Assert ( null != project , " " ) ; Debug . Assert ( null != proposedEntityContainerName , " " ) ; var entityContainerName = proposedEntityContainerName ; var suffix = 1 ; InitializeConnectionStringsHash ( ) ; Dictionary < string , ConnectionString > connStringsInProject ; if ( null != ConnStringsByProjectHash && ConnStringsByProjectHash . TryGetValue ( project , out connStringsInProject ) ) { while ( connStringsInProject . ContainsKey ( entityContainerName ) ) { entityContainerName = proposedEntityContainerName + suffix ; ++ suffix ; } } return entityContainerName ; }
Returns an EntityContainer name unique in the app/web.config for the given project
given a proposed EntityContainer name
Returns an EntityContainer name unique in the app / web . config for the given project given a proposed EntityContainer name
// keep incrementing the suffix until the existing connection string names  // does not contain the result
proposedEntityContainerName
string
project
Project