Convert NameValueCollection to Dictionary
public static class NameValueCollectionHelper
{
public static IDictionaryToDictionary
(this NameValueCollection source)
{
return source.Cast()
.Select(s => new { Key = s, Value = source[s] })
.ToDictionary(p => p.Key, p => p.Value); }
}
2 Comments:
Hi, Do you have this code in VB.net?
By 7N7, at 7:23 AM
This comment has been removed by the author.
By 7N7, at 7:24 AM
Post a Comment
<< Home