UriExtensions.TryReadQueryAs<T> Method (Uri, T%)

Reads HTML form URL encoded data provided in the URI query string as an object of a specified type.

Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function TryReadQueryAs(Of T) ( _
    address As Uri, _
    <OutAttribute> ByRef value As T _
) As Boolean
'Usage
Dim address As Uri
Dim value As T
Dim returnValue As Boolean

returnValue = address.TryReadQueryAs(value)
public static bool TryReadQueryAs<T>(
    this Uri address,
    out T value
)
[ExtensionAttribute]
public:
generic<typename T>
static bool TryReadQueryAs(
    Uri^ address, 
    [OutAttribute] T% value
)
static member TryReadQueryAs : 
        address:Uri * 
        value:'T byref -> bool 
JScript does not support generic types and methods.

Type Parameters

  • T
    The type of object to read.

Parameters

  • value
    Type: T%
    When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized.

Return Value

Type: System.Boolean
true if the query component of the URI can be read as the specified type; otherwise, false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Uri. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.108) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).

See Also

Reference

UriExtensions Class

TryReadQueryAs Overload

System.Net.Http Namespace