Share via


YieldsOutputAttribute Class

Definition

Declares that an executor may yield messages of the specified type as workflow outputs.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public sealed class YieldsOutputAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type YieldsOutputAttribute = class
    inherit Attribute
Public NotInheritable Class YieldsOutputAttribute
Inherits Attribute
Inheritance
YieldsOutputAttribute
Attributes

Examples

[YieldsOutput(typeof(FinalResult))]
[YieldsOutput(typeof(StreamChunk))]
public partial class MyExecutor : Executor
{
    // ...
}

Remarks

Apply this attribute to an Executor class to declare the types of messages it may yield via YieldOutputAsync(Object, CancellationToken). This information is used for protocol validation and documentation.

This attribute can be applied multiple times to declare multiple output types. It is inherited by derived classes, allowing base executors to declare common output types.

Constructors

Name Description
YieldsOutputAttribute(Type)

Initializes a new instance of the YieldsOutputAttribute class.

Properties

Name Description
Type

Gets the type of message that the executor may yield.

Applies to