GetDeQueueCommand() public method

Gets the de queue command.
public GetDeQueueCommand ( bool forRpc, List routes = null ) : string
forRpc bool if set to true [for RPC].
routes List The routes.
return string
コード例 #1
0
 private void BuildCommandInternal(SqlCommand selectCommand,
                                   SqlTransaction transaction, IMessageId messageId, List <string> routes)
 {
     selectCommand.Transaction = transaction;
     if (messageId != null && messageId.HasValue)
     {
         selectCommand.CommandText =
             _createDequeueStatement.GetDeQueueCommand(true, routes);
         selectCommand.Parameters.Add("@QueueID", SqlDbType.BigInt);
         selectCommand.Parameters["@QueueID"].Value = messageId.Id.Value;
     }
     else
     {
         selectCommand.CommandText =
             _createDequeueStatement.GetDeQueueCommand(false, routes);
     }
     if (_options.Value.EnableRoute && routes != null && routes.Count > 0)
     {
         var routeCounter = 1;
         foreach (var route in routes)
         {
             selectCommand.Parameters.Add("@Route" + routeCounter, SqlDbType.VarChar);
             selectCommand.Parameters["@Route" + routeCounter].Value = route;
             routeCounter++;
         }
     }
 }
コード例 #2
0
        private void BuildCommandInternal(SqlCommand selectCommand,
                                          SqlTransaction transaction, List <string> routes)
        {
            selectCommand.Transaction = transaction;
            selectCommand.CommandText =
                _createDequeueStatement.GetDeQueueCommand(routes);

            if (_options.Value.EnableRoute && routes != null && routes.Count > 0)
            {
                var routeCounter = 1;
                foreach (var route in routes)
                {
                    selectCommand.Parameters.Add("@Route" + routeCounter, SqlDbType.VarChar);
                    selectCommand.Parameters["@Route" + routeCounter].Value = route;
                    routeCounter++;
                }
            }
        }