Should I be worried about it ?
CA2211 : les champs non constants ne doivent pas être visibles (ana...
En savoir plus sur la règle d’analyse du code CA2211 : les champs non constants ne doivent pas être visibles
22 Replies
The rule of thumb is private fields public properties, yes
ok but how is it more secured ?
"Secure" as in "someone will be able to hack the user's computer"? It's not
"Secure" as in "you'll be able to make changes easier without sacrificing backwards compatibility"? Yes, definitely
i mean, i prevents potential bugs ? is that the point of it ?
Potentially, yes
how do i make a property static ? i get this error https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0120?f1url=%3FappId%3Droslyn%26k%3Dk(CS0120)
Compiler Error CS0120 - C# reference
Compiler Error CS0120
(maybe switch my post to beginner)
You just do
With the word
static
public static int SomeNumber { get; set; }
bruh how can i be such a noob
A static member cannot reference instance members
so i make the
camera
instance static ?No
I said member not class
Fields, properties, methods — those are class members
i mean not the class static, but i can make it a static var of an other class
Also, you don't need to do
it can just be
$getsetdevolve
can be shortened to
can be shortened to
can be shortened to
can be shortened to
thanks guys
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
i have a very big info list on visualStudio
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
some naming rules for example
or others simplifications that can be made