封装字段
public class Widget { private object _internalWidgetState; public string _widgetModelNumber; }
将成员变量封装在一个字段中
public class Widget { private object _internalWidgetState; public string ModelNumber {get; private set;} }
封装字段
public class Widget { private object _internalWidgetState; public string _widgetModelNumber; }
将成员变量封装在一个字段中
public class Widget { private object _internalWidgetState; public string ModelNumber {get; private set;} }