Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ICallContextInitializer::BeforeInvoke Method (InstanceContext^, IClientChannel^, Message^)

 

Implement to participate in the initialization of the operation thread.

Namespace:   System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

Object^ BeforeInvoke(
	InstanceContext^ instanceContext,
	IClientChannel^ channel,
	Message^ message
)

Parameters

instanceContext
Type: System.ServiceModel::InstanceContext^

The service instance for the operation.

channel
Type: System.ServiceModel::IClientChannel^

The client channel.

message
Type: System.ServiceModel.Channels::Message^

The incoming message.

Return Value

Type: System::Object^

A correlation object passed back as the parameter of the AfterInvoke method.

Implement the BeforeInvoke method to initialize and clean up thread-local storage for the thread that invokes user code. Typical usage is to set some value, such as impersonation or changing the System.Globalization::CultureInfo. If you wanted to establish some custom context, this is the extension point to initialize the static context property, which is then available for developers in the course of the operation.

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft