TransactedReceiveScope.Request 属性

定义

获取或设置与此 Receive 活动关联的 TransactedReceiveScope 活动。

public:
 property System::ServiceModel::Activities::Receive ^ Request { System::ServiceModel::Activities::Receive ^ get(); void set(System::ServiceModel::Activities::Receive ^ value); };
public System.ServiceModel.Activities.Receive Request { get; set; }
member this.Request : System.ServiceModel.Activities.Receive with get, set
Public Property Request As Receive

属性值

Receive

与事务处理接收范围关联的接收活动。

示例

下面的示例演示如何设置 Request 属性。

return new Sequence
{
    Activities = 
    {
        new WriteLine { Text = "Service workflow begins." },

        new System.ServiceModel.Activities.TransactedReceiveScope
        {
            Variables = { requestMessage, replyMessage },
            Request = receive,
            Body = new Sequence
            {
                Activities =
                {
                    new WriteLine { Text = new InArgument<string>("Server side: Receive complete.") },
                    
                    new WriteLine { Text = new InArgument<string>(new VisualBasicValue<string>() { ExpressionText = "\"Server side: Received = '\" + requestString.toString() + \"'\"" }) },

                    new PrintTransactionInfo(),

                    new Assign<string>
                    {
                        Value = new InArgument<string>("Server side: Sending reply."),
                        To = new OutArgument<string>(replyMessage)
                    },

                    new WriteLine { Text = new InArgument<string>("Server side: Begin reply.") },

                    new SendReply
                    {
                        Request = receive,
                        Content = SendContent.Create(new InArgument<string>(replyMessage)),                                    
                    },

                    new WriteLine { Text = new InArgument<string>("Server side: Reply sent.") },
                },
            },
        },

        new WriteLine { Text = "Server workflow ends." },
    },
};

适用于