feat: Dictionary AddRange extensions

This commit is contained in:
2026-03-11 13:21:35 +03:00
parent 821144a691
commit bf7dc5a3d4
+7 -1
View File
@@ -15,7 +15,7 @@ public static class EnumerableExtensions
strs.Add($"{enumerator.Key}: {enumerator.Value}");
return string.Join(separator, strs.Select(s => $"{new string(' ', indent)}{s}"));
}
public static string ToString<TValue>(this IEnumerable<TValue> values, string separator, int indent) => (values as IEnumerable).ToString(separator, indent);
public static string ToString(this IEnumerable values, string separator, int indent)
{
@@ -28,5 +28,11 @@ public static class EnumerableExtensions
public static bool All(this IEnumerable<bool> values) => values.All(v => v);
public static bool Any(this IEnumerable<bool> values) => values.Any(v => v);
public static void AddRange<TValue, TKey>(this IDictionary<TValue, TKey> values, IEnumerable<KeyValuePair<TValue, TKey>> collection)
{
foreach (var kv in collection)
values.Add(kv);
}
}