-1

I am using Microsoft Visual Studio Community 2015 and when I define a private variable and I use the tool "Quick actions and refactors..." (right clicking on the variable) I get the next auto-code:

private List<Test> tests;

public List<Test> Tests
{
    get
    {
       return tests;
    }

    set
    {
        tests = value;
    }
}

I do not like this long branches, I would prefer something like:

public List<Test> Tests
{
    get { return tests; }
    set { tests = value; }
}

There is a way of change this behavior?

EDIT:

What I am asking is not the same than the question linked (when marked as duplicated). I was wondering if once the variable is already created I can generate a propertie in the form I want, not to generate a new variable.

Ignacio
  • 806
  • 1
  • 10
  • 29

1 Answers1

1

Just write propfull and hit Tab twice. Look also this answer Shortcut to create properties in Visual Studio?

Community
  • 1
  • 1
GeralexGR
  • 2,973
  • 6
  • 24
  • 33