int MyProperty { set; }
What\'s the idea for using only setter on property? If we set one property with some value, I guess it\'s very likely to read t
It doesn't make a whole lot of sense to have an auto-property with only a setter. It can make sense to have a manually implemented property with only a setter that can then set a field used internally, but not visible externally.
Having a set only property is very uncommon, and are often implemented with a set method instead of a property as a set-only property is not expected behavior for most developers.
In fact, it is a compiler error for an auto-implemented property to define a set
without a get
. A set-only property must be manually defined.