using System; using System.Collections.Generic; using System.Linq; namespace Elsa.ProtoActor.Extensions; public static class CollectionExtensions { public static void AddRange(this ICollection target, IEnumerable source) { foreach (var item in source) target.Add(item); } public static void RemoveWhere(this ICollection collection, Func predicate) { var itemsToRemove = collection.Where(predicate).ToList(); foreach (var item in itemsToRemove) collection.Remove(item); } }