Is there a way to make readonly (not just private) automatic properties?

automatic-properties, c#, readonly

Solution

No, but this idea is being tracked on Connect.

Problem

Automatic properties let me replace this code: ``` private MyType myProperty; public MyType MyProperty { get { return myPropertyField; } } ``` with this code: ``` public MyType MyProperty { get; private set; } ``` with a few changes here and there - but is there a way to replace this code: ``` private readonly MyType myProperty; public MyType MyProperty { get { return myPropertyField; } } ``` with something similar?

Original source

Related problems