Skip to content

Read only collections

ikopylov edited this page Dec 26, 2014 · 1 revision

Qoollo Read Only Collections

Library provides several read-only wrappers for most commonly used collections:

List<int> testList = new List<int>();
ReadOnlyList<int> readOnlyList = testList.AsReadOnlyList();

Dictionary<int, int> testDictionary = new Dictionary<int, int>();
ReadOnlyDictionary<int, int> readOnlyDictionary = testDictionary.AsReadOnlyDictionary();

HashSet<int> testHashSet = new HashSet<int>();
ReadOnlyHashSet<int> readOnlyHashSet = testHashSet.AsReadOnlyHashSet();
Clone this wiki locally