Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. class LazySingleton
  2.     {
  3.         private static readonly Lazy<LazySingleton> _instance =
  4.             new Lazy<LazySingleton>(() => new LazySingleton());
  5.  
  6.         private LazySingleton() { }
  7.  
  8.         public static LazySingleton Instance
  9.         {
  10.             get
  11.             {
  12.                 return _instance.Value;
  13.             }
  14.         }
  15.         public void Test()
  16.         {
  17.             Console.WriteLine("blabla");
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement