You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was mentioned on CodePlex but was not implemented in C# 6.0.
I'm proposing allowing field-targeted attributes on auto-properties. The compiler would automatically attach that attribute to the generated backing field.
[field:NonSerialized]publicstring Name {get;set;}
equivalent to:
[NonSerialized]privatestring name;publicstring Name {get{return this.name;}set{ this.name = value;}}
This would bring auto-properties into parity with events which have supported this syntax since C# 1.0:
This was mentioned on CodePlex but was not implemented in C# 6.0.
I'm proposing allowing field-targeted attributes on auto-properties. The compiler would automatically attach that attribute to the generated backing field.
equivalent to:
This would bring auto-properties into parity with events which have supported this syntax since C# 1.0:
The text was updated successfully, but these errors were encountered: