C #, unfortunately, does not support const methods or constant parameters. C # 2.0 has a new feature that helps a bit in a similar scenario. With C # 2.0, get and set accessors properties can have different availability. Thus, you can make access to the access object public, and the set is protected as follows.
class MyClass { int _val; public int Val { protected set { _val = value; } get { return _val; } } }
source share