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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -