共用方式為


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

屬性值

與交易性接收範圍相關聯的接收活動。

範例

下列範例會示範如何設定 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." },
    },
};

適用於