Automatic properties were added to the language in about .net 3, which create a 'private' field, in any case, using the code:
public string foo {get;set;}
Can I get any link to this private field?
I want to do something like
public string foo {get{};set;}
Without losing this automatic property function and writing something like
private string _foo = null;
public string foo{get{_foo==null?_foo="hello"; return _foo;}set{_foo=value;}}
source
share