当我们定义一个属性时
public string Name {get; set;}
dot net 可以制作我们的属性代码。但是当我们使用
public string Name {get;}
public string Name {set;}
我们面对
'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.
实际上为什么编译器无法确定属性并自动生成代码?有什么问题?