2
Because from the version of Visual Studio 2015 every time I have an attribute generated in a class the same is generated with the set
internal
?
In previous versions VS generated as public
.
2
Because from the version of Visual Studio 2015 every time I have an attribute generated in a class the same is generated with the set
internal
?
In previous versions VS generated as public
.
0
It depends on where you want to create this property, and also on the nomenclature 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 come from, Visual Studio will try to guess the level of security of the property.
Browser other questions tagged c# visual-studio visual-studio-2015
You are not signed in. Login or sign up in order to post.
This happens when you use the shortcut
prop
?– Jéf Bueno
when I use the
Ctrl+.
– Pablo Tondolo de Vargas
Good luck: http://stackoverflow.com/q/32232135/221800 :)
– Maniero
From what I understand there, it would be that for some developers it is interesting that it manages as
internal
?– Pablo Tondolo de Vargas
I believe this is so because you created the property using the
CTRL +
within the same project, so for privacy reasons of defining the property theVS
places as Internal. I think that creating in another project should come aspublic
. It should be possible to modify this behavior by changing some template fromVS
, but I’m not sure.– Richard Dias
Yes, I remember that in 2013 he generated the classes without the public, then I edited a template to always add the public, only to generate the property I did not find which template I have to change.
– Pablo Tondolo de Vargas