应用中的单例模式


       public class SingletonProvider<T> where T : new()
       {
           SingletonProvider() { }

           public static T Instance
           {
               get { return SingletonCreator.instance; }
           }

           class SingletonCreator
           {
               static SingletonCreator() { }

               internal static readonly T instance = new T();
           }
       }
原文地址:https://www.cnblogs.com/myself/p/1765858.html