UseAsyncTemplateForAnyAwaitable
Gets or sets a value indicating whether async templates should be selected based on return type rather than the async modifier.
Declaration
protected bool UseAsyncTemplateForAnyAwaitable { get; init; }Property Value
| Type | Description |
|---|---|
| bool |
Remarks
When false (default), the OverrideAsyncMethod() template is used only for methods with the async modifier.
When true, this template is used for all methods returning awaitable types (Task,
ValueTask, IAsyncEnumerable, IAsyncEnumerator), regardless of the async modifier.
This property is useful when you want to handle all methods returning awaitable types uniformly, even if they're not marked async.