예제 #1
0
        /// <summary>
        /// Inits the specified application.
        /// </summary>
        /// <param name="application">The application.</param>
        public void Init(HttpApplication application)
        {
            if (application == null)
            {
                return;
            }

            _repository = DataBasesRepository.GetInstance();

            if (_repository.ExternalDisposeAction == null)
            {
                _repository.ExternalDisposeAction = (rep) => CloseAllDataBases();
            }

            application.BeginRequest += ApplicationBeginRequest;
            application.EndRequest   += ApplicationEndRequest;
            application.Error        += ApplicationError;
        }
예제 #2
0
 //SINGLETON
 internal static DataBasesRepository GetInstance()
 {
     return(_repository ?? (_repository = new DataBasesRepository()));
 }