josh-yates / Enable.Extensions.CollectionExtensions

C# extension methods for modifying collections.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable.Extensions.CollectionExtensions

C# extensions for modifying collections.

Build status

The AddRange() method takes an IEnumerable collection and adds the items in the collection to the source ICollection.

var source = new HashSet<int>();
var collection = new HashSet<int>();

source.AddRange(collection);

The RemoveRange() method takes an IEnumerable collection and removes the items in the collection from the source ICollection.

var source = new HashSet<int>();
var collection = new HashSet<int>();

source.RemoveRange(collection);

The Batch() method takes an int batchSize variable and returns a list of lists with the specified batch size.

var source = new HashSet<int>();
var batchSize = 5;

var batches = source.Batch(batchSize);

About

C# extension methods for modifying collections.

License:MIT License


Languages

Language:C# 100.0%