YieldsMessageAttribute Class

Definition

Caution

Use YieldsOutput instead. The Code Generator and the runtime attribute-based type mapping ignore this attribute.

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

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
[System.Obsolete("Use YieldsOutput instead. The Code Generator and the runtime attribute-based type mapping ignore this attribute.")]
public sealed class YieldsMessageAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
[<System.Obsolete("Use YieldsOutput instead. The Code Generator and the runtime attribute-based type mapping ignore this attribute.")>]
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