If I have a class that contains, for example, a List and I want other classes to be able to see the list but not set it, I can declare
You'll want to return the list as a ReadOnly list. You can do this with the following code:
using System.Collections.ObjectModel; public ReadOnlyCollection GetList() { return SomeList.AsReadOnly(); }