Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class CollectionExtensions
- {
- public static bool IsEmpty<T>(this ICollection<T> collection) // say what you want to extension
- {
- return collection.Count = 0;
- }
- public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> values)
- {
- foreach(T value in values)
- {
- collection.Add(value);
- }
- }
- // And now every ICollection has these both methods
- }
Add Comment
Please, Sign In to add comment