properties - What is the { get; set; } syntax in C#? -
i learning asp.net mvc, , can read english documents, don't understand happening code:
public class genre { public string name { get; set; } }
what mean: { get; set; }
?
it's so-called auto property, , shorthand following (similar code generated compiler):
private string name; public string name { { return this.name; } set { this.name = value; } }
Comments
Post a Comment