Is there a C# approach that allows you to define locals with program
lifetime? That is, I don't want to have to expand the scope of a variable
just so I can make it persistent.
For example, something like:
class myClass
{
int iCallCounter = 0;
int CallCounter() { return ++iCallCounter }
lifetime? That is, I don't want to have to expand the scope of a variable
just so I can make it persistent.
For example, something like:
class myClass
{
int iCallCounter = 0;
int CallCounter() { return ++iCallCounter }
Comment