Table of Contents

Class TemplateAttribute

Namespace
PatternKit.Generators.Template
Assembly
PatternKit.Generators.Abstractions.dll

Marks a partial type as a template method workflow host. The generator will produce Execute/ExecuteAsync methods that invoke steps and hooks in deterministic order.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
public sealed class TemplateAttribute : Attribute
Inheritance
TemplateAttribute
Inherited Members

Properties

ErrorPolicy

Determines how errors are handled during template execution.

public TemplateErrorPolicy ErrorPolicy { get; set; }

Property Value

TemplateErrorPolicy

ExecuteAsyncMethodName

Name of the generated asynchronous execute method. Default: "ExecuteAsync".

public string ExecuteAsyncMethodName { get; set; }

Property Value

string

ExecuteMethodName

Name of the generated synchronous execute method. Default: "Execute".

public string ExecuteMethodName { get; set; }

Property Value

string

ForceAsync

Forces generation of async method even if no async steps exist.

public bool ForceAsync { get; set; }

Property Value

bool

GenerateAsync

Whether to generate the asynchronous Execute method. If not specified, inferred from presence of ValueTask/CancellationToken in steps/hooks.

public bool GenerateAsync { get; set; }

Property Value

bool