Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LazySingleton
- {
- private static readonly Lazy<LazySingleton> _instance =
- new Lazy<LazySingleton>(() => new LazySingleton());
- private LazySingleton() { }
- public static LazySingleton Instance
- {
- get
- {
- return _instance.Value;
- }
- }
- public void Test()
- {
- Console.WriteLine("blabla");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement