From 820e2abf419a7e972e875e3c76a4fac5d9e7b7f5 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Wed, 1 Apr 2020 19:43:49 -0500 Subject: [PATCH] DictionaryExt.Add many --- Wabbajack.Common/Extensions/DictionaryExt.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Wabbajack.Common/Extensions/DictionaryExt.cs b/Wabbajack.Common/Extensions/DictionaryExt.cs index dceaf8f4..2dcf9d0f 100644 --- a/Wabbajack.Common/Extensions/DictionaryExt.cs +++ b/Wabbajack.Common/Extensions/DictionaryExt.cs @@ -18,5 +18,21 @@ namespace Wabbajack dict[key] = ret; return ret; } + + public static void Add(this IDictionary dict, IEnumerable> vals) + { + foreach (var val in vals) + { + dict.Add(val); + } + } + + public static void Set(this IDictionary dict, IEnumerable> vals) + { + foreach (var val in vals) + { + dict[val.Key] = val.Value; + } + } } }