System.Linq Namespace

Provides classes and interfaces that support language-integrated query (LINQ), which adds powerful query capabilities to .NET programming languages.

Classes

EnumerableClass

Supports the deferred execution of a query that returns a collection.

public static class Enumerable

QueryableClass

Supports the deferred execution of a query that returns an IQueryable<T>.

public static class Queryable

Grouping<TKey, TElement>Class

Represents a set of elements that have a common key.

public class Grouping<TKey, TElement> : ICollection<TElement>, IEnumerable<TElement>, IEnumerable

Interfaces

ILookup<TKey, TElement>Interface

Represents a collection of elements, indexed by a specified key and a specified element type.

public interface ILookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement>>, IEnumerable

IQueryable<T>Interface

Represents an expression tree that can be translated to a query.

public interface IQueryable<out T> : IEnumerable<T>, IEnumerable, IQueryable

IQueryProviderInterface

Represents the ability to execute queries against a data source.

public interface IQueryProvider

Extension Methods

AggregateExtension Method

Applies an accumulator function over a sequence.

public static TSource Aggregate<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, TSource> func)

WhereExtension Method

Filters a sequence of values based on a predicate.

public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)

SelectExtension Method

Projects each element of a sequence into a new form.

public static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)

OrderByExtension Method

Sorts the elements of a sequence in ascending order.

public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)