public SqlServiceBrokerOperation Receive(string queueName, TimeSpan?timeout = null, int?count = null)
        {
            if (timeout == null)
            {
                timeout = TimeSpan.FromSeconds(10.0);
            }

            if (count == null)
            {
                count = 1;
            }

            var messages = BrokerUtility.GetQueueMessages(_connection, _transaction, queueName, (TimeSpan)timeout, (int)count);

            _queueMessages.AddRange(messages);
            return(this);
        }
 public SqlServiceBrokerOperation Send(string messageTypeName, byte[] bytes)
 {
     BrokerUtility.SendQueueMessage(_connection, _transaction, _conversationHandle, messageTypeName, bytes);
     return(this);
 }
 public SqlServiceBrokerOperation EndConversation()
 {
     BrokerUtility.EndConversation(_connection, _transaction, _conversationHandle);
     return(this);
 }
 public SqlServiceBrokerOperation BeginDialog()
 {
     _conversationHandle = BrokerUtility.BeginDialog(_connection, _transaction, _fromService, _toService, _contract);
     return(this);
 }