Created
September 28, 2017 09:50
-
-
Save NMZivkovic/ee1cc13f662338488f19571f40ebefec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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