Class
EnumerableExtensions

Extension methods for working with enumerable collections.

Definition

Namespace:Telerik.DataSource.Extensions

Assembly:Telerik.DataSource.dll

Syntax:

cs-api-definition
public static class EnumerableExtensions

Inheritance: objectEnumerableExtensions

Methods

AsGenericEnumerable(IEnumerable)

Makes a generic enumerable collection from the provided collection

Declaration

cs-api-definition
public static IEnumerable AsGenericEnumerable(this IEnumerable source)

Parameters

source

IEnumerable

Returns

IEnumerable

Each<T>(IEnumerable<T>, Action<T, int>)

Invokes an action for each item of the collection

Declaration

cs-api-definition
public static void Each<T>(this IEnumerable<T> instance, Action<T, int> action)

Parameters

instance

IEnumerable<T>

the collection that will be looped

action

Action<T, int>

the action that will be called for each item in the collection

Each<T>(IEnumerable<T>, Action<T>)

Executes the provided delegate for each item.

Declaration

cs-api-definition
public static void Each<T>(this IEnumerable<T> instance, Action<T> action)

Parameters

instance

IEnumerable<T>

The instance.

action

Action<T>

The action to be applied.

IndexOf(IEnumerable, object)

Returns the index at which an element is met in a collection. Returns -1 if the element is not in the collection.

Declaration

cs-api-definition
public static int IndexOf(this IEnumerable source, object item)

Parameters

source

IEnumerable

item

object

Returns

int

SelectRecursive<TSource>(IEnumerable<TSource>, Func<TSource, IEnumerable<TSource>>)

Declaration

cs-api-definition
public static IEnumerable<TSource> SelectRecursive<TSource>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TSource>> recursiveSelector)

Parameters

source

IEnumerable<TSource>

recursiveSelector

Func<TSource, IEnumerable<TSource>>

Returns

IEnumerable<TSource>

ToReadOnlyCollection<T>(IEnumerable<T>)

Creates a read only collection from the provided source.

Declaration

cs-api-definition
public static ReadOnlyCollection<T> ToReadOnlyCollection<T>(this IEnumerable<T> sequence)

Parameters

sequence

IEnumerable<T>

Returns

ReadOnlyCollection<T>