Share via


YieldsMessageAttribute Class

Definition

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

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

Examples

[YieldsMessage(typeof(FinalResult))]
[YieldsMessage(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
YieldsMessageAttribute(Type)

Initializes a new instance of the YieldsMessageAttribute class.

Properties

Name Description
Type

Gets the type of message that the executor may yield.

Applies to