| 12345678910111213141516 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace FlowWorkEditDemo
- {
- static class CollectionHelper
- {
- public static void RemoveRange<T>(this ICollection<T> source, Func<T, bool> predicate)
- {
- var arr = source.Where(p => predicate(p)).ToArray();
- foreach (var t in arr)
- source.Remove(t);
- }
- }
- }
|