implement a really basic AddRange<T> method for a generic IList<T> and an IEnumerable<T>

This commit is contained in:
Michael Becker 2021-05-22 02:17:46 -04:00
parent 43fc5b7a67
commit 4b3dc58803
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -54,5 +54,13 @@ namespace MBS.Framework.Collections.Generic
} }
return ((List<T>)(cacheOfT[obj][typeof(T)])).ToArray(); return ((List<T>)(cacheOfT[obj][typeof(T)])).ToArray();
} }
public static void AddRange<T>(this IList<T> list, IEnumerable<T> items)
{
foreach (T item in items)
{
list.Add(item);
}
}
} }
} }