ערוך

שתף באמצעות


Selecting a Collection Class

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

Important

Avoid using the types in the System.Collections namespace. The generic and concurrent versions of the collections are recommended because of their greater type safety and other improvements.

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 IEnumerable or IEnumerable<T>. 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