public async Task CreateQueuesForEndpoint()
    {
        var connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=samples;Integrated Security=True";

        using (var sqlConnection = new SqlConnection(connectionString))
        {
            await sqlConnection.OpenAsync()
            .ConfigureAwait(false);

            await QueueCreation.CreateQueuesForEndpoint(
                connection : sqlConnection,
                schema : "dbo",
                endpointName : "myendpoint")
            .ConfigureAwait(false);

            await QueueCreation.CreateQueue(
                connection : sqlConnection,
                schema : "dbo",
                queueName : "error")
            .ConfigureAwait(false);

            await QueueCreation.CreateQueue(
                connection : sqlConnection,
                schema : "dbo",
                queueName : "audit")
            .ConfigureAwait(false);
        }
    }
    public void CreateQueuesForEndpoint()
    {
        QueueCreation.CreateQueuesForEndpoint(
            uri: "amqp://*****:*****@localhost:5672",
            endpointName: "myendpoint",
            durableMessages: true,
            createExchanges: true);

        QueueCreation.CreateQueue(
            uri: "amqp://*****:*****@localhost:5672",
            queueName: "error",
            durableMessages: true,
            createExchange: true);

        QueueCreation.CreateQueue(
            uri: "amqp://*****:*****@localhost:5672",
            queueName: "audit",
            durableMessages: true,
            createExchange: true);
    }
    public void CreateQueuesForEndpoint()
    {
        string connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=samples;Integrated Security=True";

        using (SqlConnection sqlConnection = new SqlConnection(connectionString))
        {
            sqlConnection.Open();
            QueueCreation.CreateQueuesForEndpoint(
                connection: sqlConnection,
                schema: "dbo",
                endpointName: "myendpoint");

            QueueCreation.CreateQueue(
                connection: sqlConnection,
                schema: "dbo",
                queueName: "error");

            QueueCreation.CreateQueue(
                connection: sqlConnection,
                schema: "dbo",
                queueName: "audit");
        }
    }