Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Create Method (InArgument)

SendContent.Create Method (InArgument)

.NET Framework 4.6 and 4.5

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

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft