Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio auto-generate properties

Like in Eclipse for java, where it can auto-generate getters and setters for class variables, can Visual Studio 2010 do this as well? I can't find it anywhere....

like image 473
Scott Avatar asked Oct 10 '10 15:10

Scott


2 Answers

I usually type prop in the code editor and then press Tab twice. Another possibility is to right click on the private field and Refactor -> Encapsulate Field ... or Ctrl+R,E but the first method is more convenient for me.

like image 53
Darin Dimitrov Avatar answered Oct 19 '22 23:10

Darin Dimitrov


just write propfull + TAB to auto-generate getter & setters the way Eclipse would.

like image 41
Almak Avatar answered Oct 20 '22 00:10

Almak