Example #1
0
        protected void EnsureStorage( string connectionString )
        {
            bool runInstall = CreateDatabaseIfNotExists( connectionString );

             if( runInstall )
             {
            SchemaManager.Install( connectionString );
             }

             var storage = new QueueStorage( connectionString );

             try
             {
            storage.Initialize();
             }
             catch(Exception ex)
             {
            if ( !( ex is InvalidOperationException ) && !( ex is SqlException ) )
            {
               throw;
            }

            SchemaManager.Install( connectionString );
            storage.Initialize();
             }

             using ( var qManager = new QueueManager( connectionString, port: 2204 ) )
             {
            qManager.ConfigureEndPoint();
             }

             StorageUtil.PurgeAll( connectionString );
        }