You cannot create a property in C # and initialize it at the same time. You can only do this with fields.
This is valid, but will not initialize the value ( MyList will be null ):
public List<string> MyList { get; set; }
This is valid (but this is a field, not a property):
public List<string> MyList = new List<string>();
This is not :
public List<string> MyList { get; set; } = new List<string>();
It is customary to create properties inside classes and then initialize them inside the constructor of this class.
Update: Now this is valid syntax in C # 6.0 .
qJake source share