Code Inspection: Convert property to auto-property
If the
get
and
set
accessors of a property do nothing but return or set value to a backing field,
ReSharper suggests to convert this property into an
auto-implemented property
(also known as auto-property), remove the backing field and replace all its usages with the newly
created auto-property.
Here is an example of a quick-fix suggested by this inspection:
Note that this quick-fix invokes the Convert Property to Auto-Property Refactoring, which will replace all usages of the backing field solution-wide. In some cases, e.g., if the property name is used in another context, you may need to resolve conflicts that arise.