I am specifying a public property in C# like this:
public bool SuezCanalTransversal {get; set;}
However, it appears that no private member variable is created. For example, if I override the get, and return _suezCanalTransversal;
I see that:
"_suezCanalTransversal does not exist in the current context"
.
It is no problem to simply add the associated private member variables on my own, but I was under the impression that this was now done automatically.
A few questions:
When are private member variables automatically generated for public properties and when are they not?
When a public property such as public bool SuezCanalTransversal{ get; set;}
is used, is it correct to assume a private variable: private bool _suezCanalTransversal
will be created?