I have an abstract class and I\'d like to initialize a readonly field in its protected constructor. I\'d like this readonly field to be available in derived classes.
abstract class Foo { protected readonly int _field; protected Foo(int field) { _field = field; } }
Will be appropriate as you want the derived class to be aware of it. Classes not of type Foo won't have access to _field.
Foo
_field