'c#, refactor property to access private field to expression - bodied property

Given something like this

public bool Hidden
{
    get => _hidden;
    private set => _hidden = value;
}

Or

public bool Hidden { get; private set; }

I would like to refactor the above so all set accessors of the Hidden property uses the _hidden field. In other words the property should look like this afterwards:

public bool Hidden => _hidden;

and all accessors in the class should assign a value to the field _hidden.

But I dont know how to do this using Resharper?



Solution 1:[1]

There is no chance to do this ootb with ReSharper, that's too complex. You'd have to write a custom plugin for that.

JetBrains has this fantastic template which gets you started quite fast.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mu88