Gets the value from the collection, returning defaultValue if the value doesn't exist.
Namespace: DotNetNuke.CollectionsAssembly: DotNetNuke (in DotNetNuke.dll)
Syntax
C# |
---|
public static T GetValueOrDefault<T>(
this NameValueCollection collection,
string key,
T defaultValue,
Func<Object, T> converter
)
|
Visual Basic |
---|
<ExtensionAttribute>
Public Shared Function GetValueOrDefault(Of T) (
collection As NameValueCollection,
key As String,
defaultValue As T,
converter As Func(Of Object, T)
) As T |
Type Parameters
- T
- The type of the value to retrieve
Return Value
A
T instance.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
NameValueCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see
[b8020aae-374d-46a9-bcb7-8cc2390b93b6] or
[175ce3ff-9bbf-4e64-8421-faeb81a0bb51].
Exceptions
See Also