TransactedReceiveScope.Body Właściwość

Definicja

Pobiera lub ustawia Activity element, który składa się na treść TransactedReceiveScope działania.

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

Wartość właściwości

Activity

Treść transakcyjnego zakresu odbierania.

Przykłady

W poniższym przykładzie pokazano, jak ustawić Body właściwość .

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." },
    },
};

Uwagi

Transakcja jest otoczenia przez cały czas trwania treści.

Dotyczy