src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Gets unique name for element within the passed container, based on proposed name
/// </summary>
Gets unique name for element within the passed container, based on proposed name
Gets unique name for element within the passed container based on proposed name
internal static string GetUniqueName(Type type, EFContainer container, string proposedName, HashSet<string> namesToAvoid = null)
        {
            Debug.Assert(!String.IsNullOrEmpty(proposedName), "Please specify proposedName");
            var uniqueName = proposedName;
            string msg = null;
            var childCount = container.Children.Count();
            for (var i = 1; i <= childCount; ++i)
            {
                if (IsUniqueName(type, container, uniqueName, false, out msg)
                    && (namesToAvoid == null || !namesToAvoid.Contains(uniqueName)))
                {
                    break;
                }
                uniqueName = proposedName + i;
            }
            return uniqueName;
        }
internal static string GetUniqueName ( Type type , EFContainer container , string proposedName , HashSet < string > namesToAvoid = null ) { Debug . Assert ( ! String . IsNullOrEmpty ( proposedName ) , " " ) ; var uniqueName = proposedName ; string msg = null ; var childCount = container . Children . Count ( ) ; for ( var i = 1 ; i <= childCount ; ++ i ) { if ( IsUniqueName ( type , container , uniqueName , false , out msg ) && ( namesToAvoid == null || ! namesToAvoid . Contains ( uniqueName ) ) ) { break ; } uniqueName = proposedName + i ; } return uniqueName ; }
Gets unique name for element within the passed container, based on proposed name
Gets unique name for element within the passed container based on proposed name
type
Type
container
EFContainer
proposedName
string
namesToAvoid
HashSet<string>