New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Extension methods for IEnumerable.

Definition

Namespace:Kendo.Mvc.Extensions

Assembly:Kendo.Mvc.dll

Syntax:

C#
public static class EnumerableExtensions

Inheritance: objectEnumerableExtensions

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Methods

Converts a non-generic IEnumerable to a generic IEnumerable.

C#
public static IEnumerable AsGenericEnumerable(this IEnumerable source)
Parameters:sourceIEnumerable

The source collection.

Returns:

IEnumerable

A generic IEnumerable.

Executes the provided action for each item with its index.

C#
public static void Each<T>(this IEnumerable<T> instance, Action<T, int> action)
Parameters:instanceIEnumerable<T>

The collection instance.

actionAction<T, int>

The action to be applied to each item and its index.

Executes the provided delegate for each item.

C#
public static void Each<T>(this IEnumerable<T> instance, Action<T> action)
Parameters:instanceIEnumerable<T>

The instance.

actionAction<T>

The action to be applied.

Returns the index of the specified item in the collection.

C#
public static int IndexOf(this IEnumerable source, object item)
Parameters:sourceIEnumerable

The source collection.

itemobject

The item to find.

Returns:

int

The zero-based index of the item, or -1 if not found.

Recursively selects elements from a hierarchical collection.

C#
public static IEnumerable<TSource> SelectRecursive<TSource>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TSource>> recursiveSelector)
Parameters:sourceIEnumerable<TSource>recursiveSelectorFunc<TSource, IEnumerable<TSource>>Returns:

IEnumerable<TSource>

A flattened collection of all elements.

Converts the sequence to a ReadOnlyCollection.

C#
public static ReadOnlyCollection<T> ToReadOnlyCollection<T>(this IEnumerable<T> sequence)
Parameters:sequenceIEnumerable<T>

The sequence to convert.

Returns:

ReadOnlyCollection<T>

A ReadOnlyCollection containing the elements.