Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 41
    In .NET 4.5 and higher you can declare a list as IReadOnlyList<string> instead of IList<string>. Commented Jul 4, 2014 at 9:54
  • 6
    Just to be clear, you can still change the values in an IReadOnlyList (just not add or remove elements). But yes, declaring it as an IReadOnlyList would be better than an IList. Commented Apr 13, 2020 at 16:25