Open sandboxFocus

Method GetOptions

GetOptions(in OptionsProviderContext)

Gets the list of options provided by the current aspect or attribute.

Declaration
IEnumerable<IHierarchicalOptions> GetOptions(in OptionsProviderContext context)
Parameters
Type Name Description
OptionsProviderContext context
Returns
Type Description
IEnumerable<IHierarchicalOptions>

The list of options.

Remarks

This interface behaves differently when applied to plain custom attributes than when applied to aspects.

When applied to plain custom attributes, the GetOptions(in OptionsProviderContext) method is invoked immediately in the first stage of the compilation process, therefore the provided options are immediately available for readers.

However, when the interface is implemented by an aspect, i.e. any class implementing the IAspect interface, the GetOptions(in OptionsProviderContext) method is called right before the BuildAspect(IAspectBuilder<T>) method of the aspect is invoked. The provided options are therefore only available to the current aspect instance and any code executing after this aspect instance.