Class WorkflowQueryAttribute
- Namespace
- Temporalio.Workflows
- Assembly
- Temporalio.dll
Designate a method as a query handler.
[AttributeUsage(AttributeTargets.Method|AttributeTargets.Property, Inherited = false)]
public sealed class WorkflowQueryAttribute : Attribute
- Inheritance
-
WorkflowQueryAttribute
- Inherited Members
Remarks
This is not inherited, so if a method is overridden, it must also have this attribute. The method must be a public, non-async, non-static method (i.e. cannot return a Task) and must return a non-void value.
Constructors
WorkflowQueryAttribute()
Initializes a new instance of the WorkflowQueryAttribute class with the default name. See Name.
public WorkflowQueryAttribute()
WorkflowQueryAttribute(string)
Initializes a new instance of the WorkflowQueryAttribute class with the given name.
public WorkflowQueryAttribute(string name)
Parameters
Properties
Dynamic
Gets or sets a value indicating whether the query is dynamic. If a query is dynamic, it cannot be given a name in this attribute and the method must accept a string name and an array of IRawValue.
public bool Dynamic { get; set; }
Property Value
Name
Gets the workflow query name. If this is unset, it defaults to the unqualified method name.
public string? Name { get; }