Share via


SendsMessageAttribute Class

Definition

Declares that an executor may send messages of the specified type.

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

Examples

[SendsMessage(typeof(PollToken))]
[SendsMessage(typeof(StatusUpdate))]
public partial class MyExecutor : Executor
{
    // ...
}

Remarks

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

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

Constructors

Name Description
SendsMessageAttribute(Type)

Initializes a new instance of the SendsMessageAttribute class.

Properties

Name Description
Type

Gets the type of message that the executor may send.

Applies to