Faisal Nazir’s Post

View profile for Faisal Nazir, graphic

Principal Software Engineer | Architect | .Net core | Angular

Frozen Collections: With .NET 8, the 'System.Collections.Frozen' namespace introduces two new read-only collection classes: 1. FrozenDictionary<TKey, TValue> 2.FrozenSet<T>. These collections are designed for scenarios requiring highly optimized read performance, similar to ImmutableDictionary<K, V> and ImmutableHashSet<T>, but without methods for nondestructive mutation (e.g., Add or Remove). You can create a frozen collection from an existing collection or sequence by using the ToFrozenDictionary or ToFrozenSet extension methods. Frozen collections are ideal for lookups that are initialized at the start of a program and used throughout the application’s lifecycle. #Microsoft #Dotnet8 #c

To view or add a comment, sign in

Explore topics