Freigeben über


AgentInterfaceAttribute.ProcessDelegate Property

Definition

The name of the AgentApplication method that will process requests for this interface.

public string? ProcessDelegate { get; }
member this.ProcessDelegate : string
Public ReadOnly Property ProcessDelegate As String

Property Value

Remarks

If not specified, incoming requests call an Host specific method. For example, CloudAdapter.ProcessAsync. The indicated method for the AspNet CloudAdapter would be Task MyProcessAsync(HttpRequest, HttpResponse, IAgentHttpAdapter, IAgent, CancellationToken)

Example for AspNet:

[AgentInterface(protocol: AgentTransportProtocol.ActivityProtocol, path: "/api/messages"), processDelegate: MyProcessDelegate]
class MyAgent : AgentApplication
{
   private async Task MyProcessDelegate(HttpRequest httpRequest, HttpResponse httpResponse, IAgentHttpAdapter adapter, IAgent agent, CancellationToken cancellationToken)
   {
       // Custom processing logic here

       await adapter.ProcessAsync(httpRequest, httpResponse, agent, cancellationToken).ConfigureAwait(false);

       // And/or custom processing logic here
   }
}

Applies to