SqlWorkflowInstanceStore.Promote 메서드

정의

지정한 속성을 워크플로 인스턴스와 연결하여 해당 속성의 특정 값을 기준으로 인스턴스를 쿼리할 수 있도록 합니다. 외부 쿼리에 사용할 수 있는 이러한 속성은 단순 형식(예: Int64, String 등)이거나 serialize된 이진 형식(byte[])일 수 있습니다. 일반적으로 이진 속성은 추적 데이터를 저장하는 데 사용됩니다.

public:
 void Promote(System::String ^ name, System::Collections::Generic::IEnumerable<System::Xml::Linq::XName ^> ^ promoteAsVariant, System::Collections::Generic::IEnumerable<System::Xml::Linq::XName ^> ^ promoteAsBinary);
public void Promote (string name, System.Collections.Generic.IEnumerable<System.Xml.Linq.XName> promoteAsVariant, System.Collections.Generic.IEnumerable<System.Xml.Linq.XName> promoteAsBinary);
member this.Promote : string * seq<System.Xml.Linq.XName> * seq<System.Xml.Linq.XName> -> unit
Public Sub Promote (name As String, promoteAsVariant As IEnumerable(Of XName), promoteAsBinary As IEnumerable(Of XName))

매개 변수

name
String

승격 자체의 이름입니다.

promoteAsVariant
IEnumerable<XName>

variant로 승격해야 하는 속성입니다.

promoteAsBinary
IEnumerable<XName>

이진 스트림으로 승격해야 하는 속성입니다.

설명

다음 코드 샘플에서는 SqlWorkflowInstanceStore에 Promote를 사용하는 방법을 보여 줍니다.

static void Main(string[] args)
{
    // Create service host.
    WorkflowServiceHost host = new WorkflowServiceHost(CountingWorkflow(), new Uri(hostBaseAddress));

    // Add service endpoint.
    host.AddServiceEndpoint("ICountingWorkflow", new BasicHttpBinding(), "");

    // Define SqlWorkflowInstanceStore and assign it to host.
    SqlWorkflowInstanceStoreBehavior store = new SqlWorkflowInstanceStoreBehavior(connectionString);
    List<XName> variantProperties = new List<XName>()
    {
        xNS.GetName("Count")
    };
    store.Promote("CountStatus", variantProperties, null);

    host.Description.Behaviors.Add(store);

    host.WorkflowExtensions.Add<CounterStatus>(() => new CounterStatus());
    host.Open(); // This sample needs to be run with Admin privileges.
                 // Otherwise the channel listener is not allowed to open ports.
                 // See sample documentation for details.

    // Create a client that sends a message to create an instance of the workflow.
    ICountingWorkflow client = ChannelFactory<ICountingWorkflow>.CreateChannel(new BasicHttpBinding(), new EndpointAddress(hostBaseAddress));
    client.start();

    Console.WriteLine("(Press [Enter] at any time to terminate host)");
    Console.ReadLine();
    host.Close();
}

적용 대상