コード例 #1
0
        public void SetupServiceBroker()
        {
            if (string.IsNullOrWhiteSpace(CurrentServer))
            {
                throw new InvalidOperationException(ERROR_SERVER_IS_NOT_DEFINED);
            }

            SqlScripts.ExecuteScript(ConnectionString, SqlScripts.CreateDatabaseScript());
            Guid brokerId = SqlScripts.ExecuteScalar <Guid>(ConnectionString, SqlScripts.SelectServiceBrokerIdentifierScript());

            SqlScripts.ExecuteScript(ConnectionString, SqlScripts.CreateDatabaseUserScript(brokerId));
            SqlScripts.ExecuteScript(ConnectionString, SqlScripts.CreateChannelsTableScript());
        }