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)

public static bool TryReadQueryAs<T>(
	this Uri address,
	out T value

Type Parameters


The type of object to read.


Type: System.Uri
The URI to read.
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).aspx or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).aspx.