Skip to main content

EnumerableExtensions

A static class in Alta.Api.DataTransferModels, Alta.Api.DataTransferModels.Extensions.

Small collection helpers used by the API models.

Methods​

MemberWhat it is
static void AddAll<T>(ICollection<T> list, IEnumerable<T> itemsToAdd)Adds every item from a sequence to the collection.
static IEnumerable<T> AsEnumerable<T>(T item) (iterator)Wraps a single item in a one-item sequence.
static List<T> AsList<T>(T item)Wraps a single item in a one-item list.
static IEnumerable<IEnumerable<TSource>> Batch<TSource>(IEnumerable<TSource> source, int size) (iterator)Splits a sequence into chunks of the given size; the last chunk may be shorter.
static bool ContainsAny<T>(ICollection<T> list, IEnumerable<T> otherList)True if the collection contains any item of the other sequence.
static void RemoveAll<T>(ICollection<T> list, IEnumerable<T> itemsToRemove)Removes every item of a sequence from the collection.