且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

asp.net-mvc在操作后获取字典或如何将FormCollection转换为字典

更新时间:2023-12-02 16:05:46

这与Omnu的代码等效,但对我来说似乎更优雅:

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]);