CorrelationAliasAttribute Class

Overrides the correlation parameter value when the correlation value must be obtained from a parameter other than that indicated by the CorrelationParameterAttribute. This class cannot be inherited.

Namespace:  System.Workflow.Activities
Assembly:  System.Workflow.Activities (in System.Workflow.Activities.dll)

[AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Event|AttributeTargets.Delegate, AllowMultiple = true)]
public sealed class CorrelationAliasAttribute : Attribute

To match an incoming message with the appropriate workflow instance, the message and the workflow instance must share a key. This key is called a correlation set. Typically, the key can be a single-valued correlation set. This means that an ID field in the message can be matched against an ID of the same type that is held by schedule instances.

The CorrelationAliasAttribute is applied to a method or an event on an interface on a data exchange interface.

The following code example shows how to use a CorrelationAliasAttribute to override a CorrelationParameterAttribute. This code example is from the CorrelatedLocalService SDK sample. For more information, see Correlated Local Service Sample.

[ExternalDataExchange]
[CorrelationParameter("taskId")]
public interface ITaskService2
{
    [CorrelationInitializer]
    void CreateTask(string taskId, string assignee, string text);

    [CorrelationAlias("taskId", "e.Id")]
    event EventHandler<TaskEventArgs> TaskCompleted;
}

System.Object
  System.Attribute
    System.Workflow.Activities.CorrelationAliasAttribute

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft