Generate property internal set

2

Why, since the version of Visual Studio 2015 every time I command to generate an attribute in a class, is it generating with set internal ? In previous versions VS generated as public .

    
asked by anonymous 25.04.2016 / 20:05

1 answer

0

It depends on where you want to create this property, and also the naming format.

public class Teste
{
    public Teste()
    {
        minhaProriedade = 1; // private readonly 
        OutraPropriedade = true; // public
    }

    public Metodo()
    {
        MaisUmaProp = "OK"; // como private, internal ou protected, se tiver herança
    }
}

And so it goes, depending on where the creation of the property will start, Visual Studio will try to guess its level of security.

    
25.04.2016 / 21:11