SendContent.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new SendMessageContent instance.
Overloads
Create(InArgument) |
Creates a new SendMessageContent instance with the specified message. |
Create(IDictionary<String,InArgument>) |
Creates a new SendParametersContent instance with the specified parameters. |
Create(InArgument, Type) |
Creates a new SendMessageContent instance with the specified message and message type. |
Create(InArgument)
Creates a new SendMessageContent instance with the specified message.
public:
static System::ServiceModel::Activities::SendMessageContent ^ Create(System::Activities::InArgument ^ message);
public static System.ServiceModel.Activities.SendMessageContent Create (System.Activities.InArgument message);
static member Create : System.Activities.InArgument -> System.ServiceModel.Activities.SendMessageContent
Public Shared Function Create (message As InArgument) As SendMessageContent
Parameters
- message
- InArgument
The data to send.
Returns
A SendMessageContent instance.
Examples
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) }
}
}
}
},
Applies to
Create(IDictionary<String,InArgument>)
Creates a new SendParametersContent instance with the specified parameters.
public:
static System::ServiceModel::Activities::SendParametersContent ^ Create(System::Collections::Generic::IDictionary<System::String ^, System::Activities::InArgument ^> ^ parameters);
public static System.ServiceModel.Activities.SendParametersContent Create (System.Collections.Generic.IDictionary<string,System.Activities.InArgument> parameters);
static member Create : System.Collections.Generic.IDictionary<string, System.Activities.InArgument> -> System.ServiceModel.Activities.SendParametersContent
Public Shared Function Create (parameters As IDictionary(Of String, InArgument)) As SendParametersContent
Parameters
- parameters
- IDictionary<String,InArgument>
A collection of name/value pairs with the keys containing the parameter names and the values containing the arguments.
Returns
A SendParametersContent instance.
Applies to
Create(InArgument, Type)
Creates a new SendMessageContent instance with the specified message and message type.
public:
static System::ServiceModel::Activities::SendMessageContent ^ Create(System::Activities::InArgument ^ message, Type ^ declaredMessageType);
public static System.ServiceModel.Activities.SendMessageContent Create (System.Activities.InArgument message, Type declaredMessageType);
static member Create : System.Activities.InArgument * Type -> System.ServiceModel.Activities.SendMessageContent
Public Shared Function Create (message As InArgument, declaredMessageType As Type) As SendMessageContent
Parameters
- message
- InArgument
The data to send.
- declaredMessageType
- Type
The data type that will appear in the service description and WSDL. It must be either the same as the argument type of the message or its base type.
Returns
A SendMessageContent instance.
Remarks
For more information about the declared message type, see DeclaredMessageType.
Applies to
.NET