

System.Collections.Immutable Namespace
source link: https://docs.microsoft.com/en-us/dotnet/api/system.collections.immutable?WT_mc_id=-blog-scottha&view=net-5.0
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

System.Collections.Immutable Namespace
Contains interfaces and classes that define immutable collections.
Classes
Provides methods for creating an array that is immutable; meaning it cannot be changed once it is created.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
A writable array accessor that can be converted into an ImmutableArray<T> instance without allocating extra memory.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Provides a set of initialization methods for instances of the ImmutableDictionary<TKey,TValue> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableDictionary<TKey,TValue>.Builder
Represents a hash map that mutates with little or no memory allocations and that can produce or build on immutable hash map instances very efficiently.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableDictionary<TKey,TValue>
Represents an immutable, unordered collection of keys and values.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Provides a set of initialization methods for instances of the ImmutableHashSet<T> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents a hash set that mutates with little or no memory allocations and that can produce or build on immutable hash set instances very efficiently.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents an immutable, unordered hash set.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Contains interlocked exchange mechanisms for immutable collections.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Provides a set of initialization methods for instances of the ImmutableList<T> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents a list that mutates with little or no memory allocations and that can produce or build on immutable list instances very efficiently.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents an immutable list, which is a strongly typed list of objects that can be accessed by index.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Provides a set of initialization methods for instances of the ImmutableQueue<T> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents an immutable queue.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Provides a set of initialization methods for instances of the ImmutableSortedDictionary<TKey,TValue> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableSortedDictionary<TKey,TValue>.Builder
Represents a sorted dictionary that mutates with little or no memory allocations and that can produce or build on immutable sorted dictionary instances very efficiently.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableSortedDictionary<TKey,TValue>
Represents an immutable sorted dictionary.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Provides a set of initialization methods for instances of the ImmutableSortedSet<T> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents a sorted set that enables changes with little or no memory allocations, and efficiently manipulates or builds immutable sorted sets.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents an immutable sorted set implementation.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Provides a set of initialization methods for instances of the ImmutableStack<T> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents an immutable stack.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Structs
An array enumerator.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Represents an array that is immutable; meaning it cannot be changed once it is created.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableDictionary<TKey,TValue>.Enumerator
Enumerates the contents of the immutable dictionary without allocating any memory.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableHashSet<T>.Enumerator
Enumerates the contents of the immutable hash set without allocating any memory.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Enumerates the contents of a binary tree.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Enumerates the contents of an immutable queue without allocating any memory.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableSortedDictionary<TKey,TValue>.Enumerator
Enumerates the contents of a binary tree.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
ImmutableSortedSet<T>.Enumerator
Enumerates the contents of a binary tree.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Enumerates the contents of an immutable stack without allocating any memory.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Interfaces
Remarks
With immutable collections, you can:
Share a collection in a way that its consumer can be assured that the collection never changes.
Provide implicit thread safety in multi-threaded applications (no locks required to access collections).
Follow functional programming practices.
Modify a collection during enumeration, while ensuring that the original collection does not change.
The immutable collection classes are available with .NET Core and .NET 5+, however they're not part of the core class library distributed with .NET Framework. They're available starting with .NET Framework 4.5 via NuGet.
To install the immutable collections via NuGet:
Open your project in Visual Studio and choose Manage NuGet Packages from the Project menu.
Optionally, select the Include prerelease checkbox.
This option gives you access to new prerelease versions of the immutable classes, as they become available.
Use the Search box to locate the System.Collections.Immutable package.
In the left pane, select the System.Collections.Immutable package. In the right pane, select the desired version and then choose Install.
The installation steps described above are for Visual Studio 2015. For other versions of Visual Studio, the steps might be slightly different because of differences in the user interface (UI).
Is this page helpful?
Recommend
-
79
Version 2.2.0 Compare
-
91
README.md Immutable
-
10
Manipulate immutable collections with no performance hit. Nov 9, 2020 • Yehonathan Sharvit This article is an excerpt from my upcoming book about Data Orient...
-
9
Article Flutter Immutable collections and objects for Flutter and Dart Bevan Steele 22 Oct 2020 • 2 min read
-
11
-
7
List Class (System.Collections.Generic) Version SearchSystem.Collections.GenericCollectionExtensions
-
7
Comments Copy link Task lists!
-
3
System.Collections.Concurrent Namespace Provides several thread-safe collection classes that should be used in place of the corresponding types in the
-
9
Dart Immutable CollectionsSeptember 29, 2022FlutterDart makes it pretty easy to create
-
3
Version SearchSystem.Text.Json
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK