How to make a reference type property “readonly”
问题 I have a class Bar with a private field containing the reference type Foo . I would like to expose Foo in a public property, but I do not want the consumers of the property to be able to alter Foo ... It should however be alterable internally by Bar , i.e. I can't make the field readonly . So what I would like is: private _Foo; public Foo { get { return readonly _Foo; } } ...which is of course not valid. I could just return a clone of Foo (assumming that it is IClonable ), but this is not