我最近升级到R#7.1并且我遇到了这个问题,其中To Property With Backing Field动作取代了我的支持字段并将它们移到了类的顶部.
例:
第1步:定义一个自动属性:
public class MyClass
{
//... Lots of members here
public int MyNewProperty {get;set;} // <- Create auto Property
}
Run Code Online (Sandbox Code Playgroud)
第2步:ReSharper的"带有支持领域的财产"

预期结果:
public class MyClass
{
//... Lots of members here
private int _myNewProperty; // <- Backing field immediately above property
public int MyNewProperty
{
get
{
return _myNewProperty;
}
set
{
_myNewProperty = value;
}
}
}
Run Code Online (Sandbox Code Playgroud)
获得的结果:
public class MyClass
{
private int _myNewProperty; // <- Backing field …Run Code Online (Sandbox Code Playgroud)