Open sandboxFocus

Enum SemanticallyAdvisedMethodKinds

Enumerates possible target methods for semantic advising.

Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
[Flags]
public enum SemanticallyAdvisedMethodKinds
Remarks

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 that starts the state machine.

Use this enumeration with the SemanticallyAdvisedMethodKinds, SemanticallyAdvisedMethodKinds, and SemanticallyAdvisedMethodKinds properties. Combine values to select the kinds of methods that are advised semantically.

Fields

Name Description
All

Apply semantic advising to all possible target methods.

Async

Apply semantic advising to async methods.

AsyncIterator

Apply semantic advising to async methods that return IAsyncEnumerable. Semantic advising for this C# 8.0 feature is not yet supported by PostSharp.

Default

The default behavior includes Async, ReturnsAwaitable, Iterator, and AsyncIterator, but not ReturnsEnumerable.

Iterator

Apply semantic advising to iterator methods (methods that use yield statements).

None

Do not use semantic advising.

ReturnsAwaitable

Apply semantic advising to methods that return any awaitable type (e.g. System.Threading.Tasks.Task).

ReturnsEnumerable

Apply semantic advising to methods that return IEnumerable, IEnumerator, IEnumerable<T>, or IEnumerator<T>.

See Also