Created
July 9, 2015 21:30
-
-
Save angelovstanton/689908bbbe6f44c2253d 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 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