/// <summary> /// <para> /// Gets the next available configuration name. /// </para> /// </summary> /// /// <param name="config"> /// The parent configuration of the new name. /// </param> /// <param name="prefix"> /// The prefix of the name. /// </param> /// /// <returns> /// The next available configuration name. /// </returns> private static string GetNextConfigName(IConfiguration config, string prefix) { int maxId = 1; while (true) { if (!config.ContainsChild(prefix + "_" + maxId)) { return prefix + "_" + maxId; } maxId++; } }