C#idiomatic C#
selecting-a-collection-classstandard/collections

Core library

Selecting a Collection Class

Learn how to decide which collection class in .NET to choose. Using the wrong type can restrict your use of the collection.

  • page standard/collections/selecting-a-collection-class
  • updated 03/18/2019

Be sure to choose your collection class carefully. Using the wrong type can restrict your use of the collection.

Consider the following questions:

LINQ to Objects and PLINQ

LINQ to Objects enables developers to use LINQ queries to access in-memory objects as long as the object type implements System.Collections.IEnumerable or System.Collections.Generic.IEnumerable. LINQ queries provide a common pattern for accessing data, are typically more concise and readable than standard foreach loops, and provide filtering, ordering, and grouping capabilities. For more information, see LINQ to Objects (C#) and LINQ to Objects (Visual Basic).

PLINQ provides a parallel implementation of LINQ to Objects that can offer faster query execution in many scenarios, through more efficient use of multi-core computers. For more information, see Parallel LINQ (PLINQ).

See also