共用方式為


CorrelationInitializer.CorrelationHandle 屬性

定義

取得或設定相互關聯初始設定式的 CorrelationHandle 引數。

public:
 property System::Activities::InArgument<System::ServiceModel::Activities::CorrelationHandle ^> ^ CorrelationHandle { System::Activities::InArgument<System::ServiceModel::Activities::CorrelationHandle ^> ^ get(); void set(System::Activities::InArgument<System::ServiceModel::Activities::CorrelationHandle ^> ^ value); };
public System.Activities.InArgument<System.ServiceModel.Activities.CorrelationHandle> CorrelationHandle { get; set; }
member this.CorrelationHandle : System.Activities.InArgument<System.ServiceModel.Activities.CorrelationHandle> with get, set
Public Property CorrelationHandle As InArgument(Of CorrelationHandle)

屬性值

相互關聯控制代碼引數。

範例

下列範例將示範如何在 SendReply 活動中指定相互關聯初始設定式。

new SendReply
{
    Request = submitPO,
    Content = SendContent.Create(new InArgument<int>( (e) => po.Get(e).Id)), // creates a SendMessageContent
    CorrelationInitializers =
    {
        new QueryCorrelationInitializer
        {
            // initializes a correlation based on the PurchaseOrder Id sent in the reply message and stores it in the handle
            CorrelationHandle = poidHandle,
            MessageQuerySet = new MessageQuerySet
            {
                // int is the name of the parameter being sent in the outgoing response
                { "PoId", new XPathMessageQuery("sm:body()/ser:int", Constants.XPathMessageContext) }
            }
        }
    }
},

備註

如果存在,執行時間會使用 CorrelationHandle 進行相互關聯,否則會使用傳訊活動的 CorrelatesWith 屬性。 如果都沒有,則會使用 CorrelationScope 所提供的環境控制代碼或工作流程服務。

適用於