Skip to content

Instantly share code, notes, and snippets.

@OliverRC
Created November 14, 2014 08:00
Show Gist options
  • Save OliverRC/754e6d5414296eda7f32 to your computer and use it in GitHub Desktop.
Save OliverRC/754e6d5414296eda7f32 to your computer and use it in GitHub Desktop.
Singleton
public sealed class Singleton
{
private static readonly Lazy<Singleton> lazy =
new Lazy<Singleton>(() => new Singleton());
public static Singleton Instance { get { return lazy.Value; } }
private Singleton()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment