What\'s the standard way to get a typed, readonly empty list in C#, or is there one?
ETA: For those asking \"why?\": I have a virtual method that re
What about:
readonly List<T> mylist = new List<T>();
Not sure why you want it readonly; that doesn't make much sense in most scenarios I can think of, though.
If you want a list whose contents can't be modified, you can do:
ReadOnlyCollection<Foo> foos = new List<Foo>().AsReadOnly();