I have a class where I declare static variables with a get method. Apparently that's all it took. I was under the impression this couldn't be done, and so I never even gave it a shot. Talk about time wasted.
Anyway, here is an example:
Code: Select all
static Element _varElement = null;
public static Element varElement
{
get
{
if(_varElement = null)
_varElement = repo.SomeElement;
return _varElement;
}
}