ClassEnumerableExtensions
Extension methods for working with enumerable collections.
Definition
Namespace:Telerik.DataSource.Extensions
Assembly:Telerik.DataSource.dll
Syntax:
public static class EnumerableExtensions
Inheritance: objectEnumerableExtensions
Methods
AsGenericEnumerable(IEnumerable)
Makes a generic enumerable collection from the provided collection
Declaration
public static IEnumerable AsGenericEnumerable(this IEnumerable source)
Parameters
source
Returns
Each<T>(IEnumerable<T>, Action<T, int>)
Invokes an action for each item of the collection
Declaration
public static void Each<T>(this IEnumerable<T> instance, Action<T, int> action)
Parameters
instance
IEnumerable<T>
the collection that will be looped
action
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
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
public static int IndexOf(this IEnumerable source, object item)
Parameters
source
item
Returns
SelectRecursive<TSource>(IEnumerable<TSource>, Func<TSource, IEnumerable<TSource>>)
Declaration
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
public static ReadOnlyCollection<T> ToReadOnlyCollection<T>(this IEnumerable<T> sequence)
Parameters
sequence
IEnumerable<T>
Returns