asp.net-mvc get a dictionary in post action or how to transform FormCollection into a dictionary
This is just an equivalent of Omnu's code, but it seems more elegant to me:
Dictionary<string, string> form = formCollection.AllKeys.ToDictionary(k => k, v => formCollection[v]);
I did it like this:
var form = new Dictionary<string, string>();
foreach (var key in formCollection.AllKeys)
{
var value = formCollection[key];
form.Add(key, value);
}