title: How can I pass variable to Action?
body: <p>below is the code sample, I want the components in the queue to take the local variable "entity", how can I achive this? thx</p>
  
  <pre><code>private void DoComparison(StuffEntity entity)
      {
          try
          {
              bool dataFlag = CheckIsNewData(entity.PickingTime, entity.WarningPeriod);
              if (dataFlag)  
              {
                  Queue&lt;Action&lt;StuffEntity&gt;&gt; queue = new Queue&lt;Action&lt;StuffEntity&gt;&gt;();
                  //How can I let the queue stuff take the entity?
                  queue.Enqueue(DelaySendingMessageOut);
                  if (!QueueItem.ContainsKey(entity.FridgeID))
                  {
                      QueueItem.Add(entity.FridgeID, queue);
                  }
              }
          }
          catch (Exception ex)
          {
              CommonUnity.WriteLog(ex.Message);
              CommonUnity.WriteLog(ex.StackTrace);
          }
      }
  
      private void DelaySendingMessageOut(StuffEntity entity)
      {
          int pendingPeroid = entity.PendingTime.ToInt();
          if (pendingPeroid &lt;= 0)
              pendingPeroid = 5;  
  
          Thread.Sleep(pendingPeroid * 60 * 1000); 
          TriggerCheckingBeforeSendMessageOut(entity);
      }
  </code></pre>