Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created July 9, 2015 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/689908bbbe6f44c2253d to your computer and use it in GitHub Desktop.
Save angelovstanton/689908bbbe6f44c2253d to your computer and use it in GitHub Desktop.
public abstract class ThreadSafeLazyBaseSingleton<T>
where T : new()
{
private static readonly Lazy<T> lazy = new Lazy<T>(() => new T());
public static T Instance
{
get
{
return lazy.Value;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment