Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quick create C# properties from variables

For C#, I hate writing out the variables and then writing out all the properties. Isn't there a way to select all variables, right click and create all the properties.

like image 224
user204588 Avatar asked Apr 27 '10 19:04

user204588


1 Answers

Right click on the field declaration, menu Refactor -> Encapsulate field and you go from

int n;

to

int n;

public int N
{
   get { return n; }
   set { n = value; }
}
like image 168
mico Avatar answered Oct 18 '22 04:10

mico