I have been converting a fair bit of code recently from VB to C# and I have noticed in VB you can initiate a new obj using shorthand, is this possible in C# or do you have to use a backing field.
Public Property MyList As New List(Of String)
It appears that the C# equivalent is:
private List<String> _myList = new List<string>();
public List<String> MyList
{
get { return _myList; }
set { _myList = value; }
}
Note* The pain of writing out this can be made much easier by using the shortcut command 'propfull'