Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
namespace SingletonExamples
{
/// <summary>
/// Using static constructor.
/// </summary>
public class SingletonStatic
{
private static SingletonStatic instance;
private SingletonStatic() { }
static SingletonStatic()
{
instance = new SingletonStatic();
}
public static SingletonStatic Instance
{
get { return instance; }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment