Example #1
0
 /// <summary>
 /// Sets the session provider of Type T to the specified concrete instance provider.
 /// The generic argument T "should" be an interface so different implementations
 /// can be set and used for testing.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="provider"></param>
 public static void SetSessionProvider <T>(object provider, bool allowReset)
 {
     lock (sessionProviderLock)
     {
         ImplementationProviders providers = GetSessionSingleton <ImplementationProviders>();
         providers.SetProvider <T>(provider, allowReset);
     }
 }
Example #2
0
        /// <summary>
        /// Set a singleton instance provider of the generic type T.
        /// Can only be called again if allowOverwrite is true.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="provider"></param>
        /// <param name="allowOverwrite"></param>
        public static void SetApplicationProvider <T>(object provider, bool allowOverwrite)
        {
            ImplementationProviders providers = GetApplicationSingleton <ImplementationProviders>();

            providers.SetProvider <T>(provider, allowOverwrite);
        }