Ejemplo n.º 1
0
        private string MakeAppLayoutSectionNameFor(
            string layoutName,
            string appName
            )
        {
            var allSections = new HashSet <string>(
                _config.Sections.ToArray(),
                new CaseInsensitiveStringComparer()
                );
            var idx    = 1;
            var prefix = _sectionNameHelper.CreateAppLayoutSectionNameFor(layoutName, appName);

            while (true)
            {
                var attempt = $"{prefix} #{idx++}";
                if (!allSections.Contains(attempt))
                {
                    return(attempt);
                }
            }
        }