My view is not a strongly typed view, and I need to iterate through Request Params in the controller action to determine the published values.
Is there a better way to iterate through nameValueCollection AllKeys?
I am currently reviewing query parameters and setting values ββaccordingly.
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];
}
I see a significant number of repetitions in this code. Is there a better way to handle this?
source
share