title: Pattern to iterate Request Params
body: <p>My view is not a strongly typed view and I need to iterate through Request Params in the controller action to determine the values posted. </p>
  
  <p>Is there a better way to iterate through the nameValueCollection AllKeys?</p>
  
  <p>I am currently looping through the Request Params and setting values appropriately.</p>
  
  <pre><code> foreach (var key in Request.Params.AllKeys)
   { 
       if (key.Equals("CustomerId"))
          queryObject.CustomerId = Request.Params[key];
       else if (key.Equals("OrderId"))
         queryObject.OrderId= Request.Params[key];
       //and so on
   }
  </code></pre>
  
  <p>I see a considerable amount of repetition in this code. Is there a better way to handle this?</p>