.NET API Documentation

Namespace: System.Linq

The System.Linq namespace provides classes and interfaces that support queries that use Language-Integrated Query (LINQ). It includes standard query operators, extension methods for collections, and types for representing queries.

Assembly: System.Linq.dll

Types

Classes ▾
  • Enumerable - Provides static methods for querying objects that implement IEnumerable<T>.
  • Queryable - Provides static methods for querying data structures that implement IQueryable<T>.
  • Grouping<TKey,TElement> - Represents a collection of objects that have a common key.
Interfaces ▾
Enumerations ▾
Delegates ▾

Sample Code

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        int[] numbers = { 5, 3, 9, 1, 4 };
        var ordered = numbers.OrderBy(n => n);
        Console.WriteLine(string.Join(", ", ordered)); // Output: 1, 3, 4, 5, 9
    }
}