Is there a way to use a collection initializer when also using automatic properties?
// Uses collection initializer but not automatic properties
private List<int> _numbers = new List<int>();
public List<int> Numbers
{
get { return _numbers; }
set { _numbers = value; }
}
// Uses automatic properties but not collection initializer
public List<int> Numbers { get; set; }
// Is there some way to do something like this??
public List<int> Numbers { get; set; } = new List<int>();