属性扩展是指封装好的类中添加更多属性,使成员变量属性进一步改变,具备直接使用,避免重复判断
private bool _Sex; public bool Sex { get { return _Sex; } set { _Sex = value; } } //性别扩展 public string Sexstr { get { return _Sex ? "男" : "女"; } } private DateTime _Birthday; public DateTime Birthday { get { return _Birthday; } set { _Birthday = value; } }