AsyncWcfLib

WcfExtensionMethods.On(T) Method

Execute code, when message type matches the template parameter. Used to add lambda expressions, e.g.

rsp.On<WcfIdleMessage>(idle => {do something with idle message 'idle'})

.On<WcfErrorMessage>(err => {do something with error message 'err'})

[Extension]
public static WcfReqIdent On<T>(
   this WcfReqIdent id,
   this Action<T> handle
)
where T : class, IWcfMessage;

Parameters

id
Parameter is added by the compiler.
handle
A delegate or lambda expression that will be executed, when the type matches.

Return Value

The same request, for chained calls.

See Also

WcfExtensionMethods Class | SourceForge.AsyncWcfLib Namespace