Show / Hide Table of Contents

Class Collection

Provides utility methods to work with collections.

Inheritance
Object
Collection
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: DotNext.Collections.Generic
Assembly: DotNext.dll
Syntax
public static class Collection

Methods

| Improve this Doc View Source

AddAll<T>(ICollection<T>, IEnumerable<T>)

Adds multiple items into collection.

Declaration
public static void AddAll<T>(this ICollection<T> collection, IEnumerable<T> items)
Parameters
Type Name Description
ICollection<T> collection

A collection to modify.

IEnumerable<T> items

An items to add into collection.

Type Parameters
Name Description
T

Type of collection items.

| Improve this Doc View Source

Convert<TInput, TOutput>(IReadOnlyCollection<TInput>, ValueFunc<TInput, TOutput>)

Returns lazily converted read-only collection.

Declaration
public static ReadOnlyCollectionView<TInput, TOutput> Convert<TInput, TOutput>(this IReadOnlyCollection<TInput> collection, in ValueFunc<TInput, TOutput> converter)
Parameters
Type Name Description
IReadOnlyCollection<TInput> collection

Read-only collection to convert.

ValueFunc<TInput, TOutput> converter

A collection item conversion function.

Returns
Type Description
ReadOnlyCollectionView<TInput, TOutput>

Lazily converted read-only collection.

Type Parameters
Name Description
TInput

Type of items in the source collection.

TOutput

Type of items in the target collection.

| Improve this Doc View Source

Convert<TInput, TOutput>(IReadOnlyCollection<TInput>, Converter<TInput, TOutput>)

Returns lazily converted read-only collection.

Declaration
public static ReadOnlyCollectionView<TInput, TOutput> Convert<TInput, TOutput>(this IReadOnlyCollection<TInput> collection, Converter<TInput, TOutput> converter)
Parameters
Type Name Description
IReadOnlyCollection<TInput> collection

Read-only collection to convert.

Converter<TInput, TOutput> converter

A collection item conversion function.

Returns
Type Description
ReadOnlyCollectionView<TInput, TOutput>

Lazily converted read-only collection.

Type Parameters
Name Description
TInput

Type of items in the source collection.

TOutput

Type of items in the target collection.

| Improve this Doc View Source

ToArray<T>(ICollection<T>)

Converts collection into single-dimensional array.

Declaration
public static T[] ToArray<T>(ICollection<T> collection)
Parameters
Type Name Description
ICollection<T> collection

A collection to convert.

Returns
Type Description
T[]

Array of collection items.

Type Parameters
Name Description
T

Type of collection items.

| Improve this Doc View Source

ToArray<T>(IReadOnlyCollection<T>)

Converts read-only collection into single-dimensional array.

Declaration
public static T[] ToArray<T>(IReadOnlyCollection<T> collection)
Parameters
Type Name Description
IReadOnlyCollection<T> collection

A collection to convert.

Returns
Type Description
T[]

Array of collection items.

Type Parameters
Name Description
T

Type of collection items.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX