次の方法で共有


HttpRequestMessageExtensions.GetSynchronizationContext Method

Retrieves the SynchronizationContext for the given request or null reference (Nothing in Visual Basic) if not available.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetSynchronizationContext ( _
    request As HttpRequestMessage _
) As SynchronizationContext
'Usage
Dim request As HttpRequestMessage 
Dim returnValue As SynchronizationContext 

returnValue = request.GetSynchronizationContext()
public static SynchronizationContext GetSynchronizationContext(
    this HttpRequestMessage request
)
[ExtensionAttribute]
public:
static SynchronizationContext^ GetSynchronizationContext(
    HttpRequestMessage^ request
)
static member GetSynchronizationContext : 
        request:HttpRequestMessage -> SynchronizationContext
public static function GetSynchronizationContext(
    request : HttpRequestMessage
) : SynchronizationContext

Parameters

  • request
    Type: HttpRequestMessage

    The HTTP request.

Return Value

Type: System.Threading.SynchronizationContext
The SynchronizationContext for the given request or null reference (Nothing in Visual Basic) if not available.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpRequestMessage. 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

HttpRequestMessageExtensions Class

System.Net.Http Namespace