src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Gets unique name for element within the passed container, based on default name followed by a unique number
/// </summary>
Gets unique name for element within the passed container, based on default name followed by a unique number
Gets unique name for element within the passed container based on default name followed by a unique number
internal static string GetUniqueNameWithNumber(Type type, EFContainer item, string defaultName)
        {
            Debug.Assert(!String.IsNullOrEmpty(defaultName), "Please specify defaultName");
            var uniqueName = defaultName + 1;
            string msg = null;
            var childCountPlusOne = item.Children.Count() + 1; 
            for (var i = 2; i <= childCountPlusOne; ++i)
            {
                if (IsUniqueName(type, item, uniqueName, false, out msg))
                {
                    break;
                }
                uniqueName = defaultName + i;
            }
            return uniqueName;
        }
internal static string GetUniqueNameWithNumber ( Type type , EFContainer item , string defaultName ) { Debug . Assert ( ! String . IsNullOrEmpty ( defaultName ) , " " ) ; var uniqueName = defaultName + 1 ; string msg = null ; var childCountPlusOne = item . Children . Count ( ) + 1 ; for ( var i = 2 ; i <= childCountPlusOne ; ++ i ) { if ( IsUniqueName ( type , item , uniqueName , false , out msg ) ) { break ; } uniqueName = defaultName + i ; } return uniqueName ; }
Gets unique name for element within the passed container, based on default name followed by a unique number
Gets unique name for element within the passed container based on default name followed by a unique number
// offset by one because we start at 2
type
Type
item
EFContainer
defaultName
string