-
-
Save lgolubyev/616ed1f96a2b0e16b429ceded562bba4 to your computer and use it in GitHub Desktop.
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 sealed class Singleton | |
{ | |
private static readonly Lazy<Singleton> LazyInstance = | |
new Lazy<Singleton>(() => new Singleton()); | |
private Singleton() | |
{ | |
} | |
public static Singleton Instance => LazyInstance.Value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment