Export (0) Print
Expand All

While Constructor

Creates a new instance of the While activity.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method While() Creates a new instance of the While activity.
Public method While(Activity<Boolean>) Creates a new instance of the While activity.
Public method While(Expression<Func<ActivityContext, Boolean>>) Creates a new instance of the While activity.
Top

The following code sample demonstrates creating a While activity. This example is from the Content-Based Correlation sample.

new While
{
    Condition = true,
    Body = new Receive
    {
        ServiceContractName = Constants.POContractName,
        OperationName = Constants.UpdatePOName,                                    
        CorrelatesWith = poidHandle, // identifies that the UpdatePO operation is waiting on the PurchaseOrderId that was used to initialize this handle
        CorrelatesOn = new MessageQuerySet // the query that is used on an incoming message to find the requisite PurchaseOrderId specified in the correlation
        {
            // Id is the name of the incoming parameter within the PurchaseOrder
            { "PoId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:Id", Constants.XPathMessageContext) } 
        },
        Content = ReceiveContent.Create(new OutArgument<PurchaseOrder>(po)) // creates a ReceiveMessageContent
    }
},
Show:
© 2014 Microsoft