当我们定义一个属性时
public string Name {get; set;}
Run Code Online (Sandbox Code Playgroud)
dot net可以使我们的属性代码.但是当我们使用时
public string Name {get;}
public string Name {set;}
Run Code Online (Sandbox Code Playgroud)
我们面对
'Hajloo.SomeThing.PropertyName.set' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors.
Run Code Online (Sandbox Code Playgroud)
实际上为什么编译器无法确定属性并自动生成代码?有什么问题?