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

mysql - How to insert just year and month into date field? -

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -