Versión Copiada del tfs
This commit is contained in:
16
Extensiones/NameValueCollection.vb
Normal file
16
Extensiones/NameValueCollection.vb
Normal file
@@ -0,0 +1,16 @@
|
||||
Imports System.Runtime.CompilerServices
|
||||
|
||||
Namespace Extensiones
|
||||
Public Module NameValueCollection
|
||||
|
||||
<Extension()>
|
||||
Public Function ToPairs(collection As Specialized.NameValueCollection) As IEnumerable(Of KeyValuePair(Of String, String))
|
||||
If collection Is Nothing Then
|
||||
Throw New ArgumentNullException("collection")
|
||||
End If
|
||||
|
||||
Return collection.Cast(Of String)().[Select](Function(key) New KeyValuePair(Of String, String)(key, collection(key)))
|
||||
End Function
|
||||
|
||||
End Module
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user