static void ConfigureConnection(TransportExtensions <SqlServerTransport> transport, TransportSettings transportSettings)
        {
            var connectionString = transportSettings.ConnectionString
                                   .RemoveCustomConnectionStringParts(out var customSchema, out var subscriptionsTableSetting);

            var subscriptions = transport.SubscriptionSettings();

            if (customSchema != null)
            {
                transport.DefaultSchema(customSchema);
                subscriptions.SubscriptionTableName(defaultSubscriptionTableName, customSchema);
            }

            if (subscriptionsTableSetting != null)
            {
                var subscriptionsAddress = QueueAddress.Parse(subscriptionsTableSetting);

                subscriptions.SubscriptionTableName(
                    tableName: subscriptionsAddress.Table,
                    schemaName: subscriptionsAddress.Schema ?? customSchema,
                    catalogName: subscriptionsAddress.Catalog
                    );
            }

            transport.ConnectionString(connectionString);

            transport.EnableMessageDrivenPubSubCompatibilityMode();
        }
Ejemplo n.º 2
0
        static void ConfigureConnection(TransportExtensions <SqlServerTransport> transport, TransportSettings transportSettings)
        {
            var builder = new DbConnectionStringBuilder
            {
                ConnectionString = transportSettings.ConnectionString
            };

            if (builder.TryGetValue(queueSchemaName, out var customSchema))
            {
                builder.Remove(queueSchemaName);

                transport.DefaultSchema((string)customSchema);
            }

            transport.ConnectionString(builder.ConnectionString);
        }