Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created September 28, 2017 09:50
Show Gist options
  • Save NMZivkovic/ee1cc13f662338488f19571f40ebefec to your computer and use it in GitHub Desktop.
Save NMZivkovic/ee1cc13f662338488f19571f40ebefec to your computer and use it in GitHub Desktop.
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