Top "Readonly-collection" questions

Represents a strongly-typed, read-only collection of elements.

Read-only list or unmodifiable list in .NET 4.0

From what I can tell, .NET 4.0 still lacks read-only lists. Why does the framework still lack this functionality? Isn't this …

c# java .net readonly-collection
ReadOnlyCollection or IEnumerable for exposing member collections?

Is there any reason to expose an internal collection as a ReadOnlyCollection rather than an IEnumerable if the calling code …

c# .net collections ienumerable readonly-collection
What is a read only collection?

I ran a security code analyst i found myself having a CA2105 warning. I looked at the grade tampering example. …

c# wcf readonly readonly-collection
How to properly use IReadOnlyDictionary?

From msdn: Represents a generic read-only collection of key/value pairs. However consider following: class Test { public IReadOnlyDictionary<string, …

c# dictionary readonly-collection
How can I access a element of a IReadOnlyCollection through it index?

I am working with selenium and I am using the function FindElements so I am getting a element that implements …

c# selenium listiterator readonly-collection
Converting Dictionary<TKey, List<TValue>> to ReadOnlyDictionary<TKey, ReadOnlyCollection<TValue>>

I have a dictionary as follows: public enum Role { Role1, Role2, Role3, } public enum Action { Action1, Action2, Action3, } var dictionary = …

c# .net dictionary readonly-collection
How to create an empty IReadOnlyCollection

I'm creating an extension method for MultiValueDictionary to encapsulate frequent ContainsKey checks and I was wondering what was the best …

c# .net readonly-collection multi-value-dictionary
Return ReadOnlyCollection from IList<>

OK, so List<> contains the AsReadOnly() which gives you the ReadOnlyCollection. What I need is to have a …

c# .net nhibernate ilist readonly-collection
Why am I getting error: "cannot implicitly convert type System.Collections.Generic.List"

I have the following sealed class. I'm trying to return the list as a ReadOnlyCollection. Tried a couple of things …

c# readonly-collection
Why doesn't ReadOnlyCollection<> include methods like FindAll(), FindFirst(),

Following the suggestions of FxCop and my personal inclination I've been encouraging the team I'm coaching to use ReadOnlyCollections as …

c# collections readonly-collection