From 4b3dc58803beec67587fb6224b3e315c966a8c0a Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 22 May 2021 02:17:46 -0400 Subject: [PATCH] implement a really basic AddRange method for a generic IList and an IEnumerable --- MBS.Framework/Collections/Generic/ExtensionMethods.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MBS.Framework/Collections/Generic/ExtensionMethods.cs b/MBS.Framework/Collections/Generic/ExtensionMethods.cs index af230fa..971c542 100644 --- a/MBS.Framework/Collections/Generic/ExtensionMethods.cs +++ b/MBS.Framework/Collections/Generic/ExtensionMethods.cs @@ -54,5 +54,13 @@ namespace MBS.Framework.Collections.Generic } return ((List)(cacheOfT[obj][typeof(T)])).ToArray(); } + + public static void AddRange(this IList list, IEnumerable items) + { + foreach (T item in items) + { + list.Add(item); + } + } } }