<PackageReference Include="Newtonsoft.Json" Version="4.0.5" />

CollectionUtils

static class CollectionUtils
public static bool AddDistinct<T>(this IList<T> list, T value)

public static bool AddDistinct<T>(this IList<T> list, T value, IEqualityComparer<T> comparer)

public static void AddRange<T>(this IList<T> initial, IEnumerable<T> collection)

Adds the elements of the specified collection to the specified generic IList.

public static void AddRange(this IList initial, IEnumerable collection)

public static bool AddRangeDistinct<T>(this IList<T> list, IEnumerable<T> values)

public static bool AddRangeDistinct<T>(this IList<T> list, IEnumerable<T> values, IEqualityComparer<T> comparer)

public static IEnumerable<T> CastValid<T>(this IEnumerable enumerable)

public static bool ContainsValue<TSource>(this IEnumerable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)

public static object CreateAndPopulateList(Type listType, Action<IList, bool> populateList)

public static IWrappedCollection CreateCollectionWrapper(object list)

public static IWrappedDictionary CreateDictionaryWrapper(object dictionary)

public static IDictionary CreateGenericDictionary(Type keyType, Type valueType)

public static IList CreateGenericList(Type listType)

public static List<T> CreateList<T>(T[] values)

public static List<T> CreateList<T>(ICollection collection)

public static IWrappedList CreateListWrapper(object list)

public static List<T> Distinct<T>(List<T> collection)

public static List<List<T>> Flatten<T>(IList<T>[] lists)

public static T GetSingleItem<T>(IList<T> list)

public static T GetSingleItem<T>(IList<T> list, bool returnDefaultIfEmpty)

public static Dictionary<K, List<V>> GroupBy<K, V>(ICollection<V> source, Func<V, K> keySelector)

Group the collection using a function which returns the key.

public static int IndexOf<T>(this IEnumerable<T> collection, Func<T, bool> predicate)

public static int IndexOf<TSource>(this IEnumerable<TSource> list, TSource value) where TSource : IEquatable<TSource>

Returns the index of the first occurrence in a sequence by using the default equality comparer.

public static int IndexOf<TSource>(this IEnumerable<TSource> list, TSource value, IEqualityComparer<TSource> comparer)

Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer.

public static bool IsCollectionType(Type type)

public static bool IsDictionaryType(Type type)

public static bool IsListType(Type type)

public static bool IsNullOrEmpty(ICollection collection)

Determines whether the collection is null or empty.

public static bool IsNullOrEmpty<T>(ICollection<T> collection)

Determines whether the collection is null or empty.

public static bool IsNullOrEmptyOrDefault<T>(IList<T> list)

Determines whether the collection is null, empty or its contents are uninitialized values.

public static bool ListEquals<T>(IList<T> a, IList<T> b)

public static IList<T> Minus<T>(IList<T> list, IList<T> minus)

public static IList<T> Slice<T>(IList<T> list, int? start, int? end)

Makes a slice of the specified list in between the start and end indexes.

public static IList<T> Slice<T>(IList<T> list, int? start, int? end, int? step)

Makes a slice of the specified list in between the start and end indexes, getting every so many items based upon the step.

public static Array ToArray(Array initial, Type type)

public static bool TryGetSingleItem<T>(IList<T> list, out T value)

public static bool TryGetSingleItem<T>(IList<T> list, bool returnDefaultIfEmpty, out T value)