是否可以使用 C# 自动属性来创建对象的新实例?
在 C# 中,我喜欢如何做到这一点:
public string ShortProp {get; set;}
是否可以对像 List 这样首先需要实例化的对象执行此操作?
IE:
List<string> LongProp = new List<string>();
public List<string> LongProp {
get {
return LongProp ;
}
set {
LongProp = value;
}
}