ForEach<T>.Body Property

Definition

The ActivityAction to be executed for each item in the Values collection.

public:
 property System::Activities::ActivityAction<T> ^ Body { System::Activities::ActivityAction<T> ^ get(); void set(System::Activities::ActivityAction<T> ^ value); };
public System.Activities.ActivityAction<T> Body { get; set; }
member this.Body : System.Activities.ActivityAction<'T> with get, set
Public Property Body As ActivityAction(Of T)

Property Value

The action to be executed.

Examples

The following code sample demonstrates setting the Body property of a ForEach<T> activity.

new ForEach<int>
{
    Values =  new ArgumentValue<IEnumerable<int>> { ArgumentName = "Numbers" },
    Body = new ActivityAction<int>
    {
        Argument = iterationVariable,
        Handler = new Assign<int>
        {
            To = accumulator,
            Value = new InArgument<int>(env => iterationVariable.Get(env) +  accumulator.Get(env))
        }
    }
},

Applies to