SemanticallyAdvisedMethodKinds Enumeration |
Enumerates possible target methods for semantic advising.
Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
[FlagsAttribute] public enum SemanticallyAdvisedMethodKinds
Member name | Value | Description | |
---|---|---|---|
None | 0 | Do not use semantic advising. | |
Async | 1 | Apply semantic advising to async methods. | |
ReturnsAwaitable | 2 | Apply semantic advising to methods that return any awaitable type (e.g. System.Threading.Tasks.Task). | |
Iterator | 4 | Apply semantic advising to iterator methods (methods that use yield statements). | |
ReturnsEnumerable | 8 | Apply semantic advising to methods that return IEnumerable, IEnumerator, IEnumerable<T>, or IEnumerator<T>. | |
AsyncIterator | 16 | Apply semantic advising to async methods which return IAsyncEnumerable. Semantic advising for this C# 8.0 feature is not supported by PostSharp yet. | |
Default | 23 | The default behavior includes Async, ReturnsAwaitable, Iterator, and AsyncIterator, but not ReturnsEnumerable. | |
All | 31 | Apply semantic advising to all possible target methods. |
When semantic advising is enabled the advices work at the abstraction level of the original programming language.
For example, advices are applied to the underlying async state machine instead of the public async method the starts the state machine.