Last active
December 16, 2015 06:52
-
-
Save osya/5f5bd696f3d1a7e5b76a to your computer and use it in GitHub Desktop.
Singleton pattern in C# #CSharp
This file contains 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
public class Singleton | |
{ | |
private static Singleton _singleton; | |
static Singleton() | |
{ | |
_singleton = new Singleton(); | |
} | |
private Singleton() | |
{ | |
} | |
public static Singleton Instance | |
{ | |
get { return _singleton; } | |
} | |
public int Count { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compact...