SendContent.Create Method (InArgument)

.NET Framework (current version)
 

Creates a new SendMessageContent instance with the specified message.

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

public static SendMessageContent Create(
	InArgument message
)

Parameters

message
Type: System.Activities.InArgument

The data to send.

The following example shows how to use the SendContent class to specify the SendMessageContent for a SendReply activity. This example uses a lambda expression to specify the InArgument. For more information about lambda expressions, see Lambda Expressions

new SendReply
{
    Request = submitPO,
    Content = SendContent.Create(new InArgument<int>( (e) => po.Get(e).Id)), // creates a SendMessageContent
    CorrelationInitializers =
    {
        new QueryCorrelationInitializer
        {
            // initializes a correlation based on the PurchaseOrder Id sent in the reply message and stores it in the handle
            CorrelationHandle = poidHandle,
            MessageQuerySet = new MessageQuerySet
            {
                // int is the name of the parameter being sent in the outgoing response
                { "PoId", new XPathMessageQuery("sm:body()/ser:int", Constants.XPathMessageContext) }
            }
        }
    }                        
}, 

.NET Framework
Available since 4.0
Return to top
Show: