Open sandboxFocus

Method Configure

Configure(Action<IInterceptorMethodBuilder>)

Adds a delegate that shapes the synthesized method for each call site, for instance to rename it, to change the type of a parameter, or to add a parameter and give its value at the call site.

Declaration
IConfiguredTemplateInterception Configure(Action<IInterceptorMethodBuilder> configure)
Parameters
Type Name Description
Action<IInterceptorMethodBuilder> configure

The delegate. It receives an IInterceptorMethodBuilder, whose rules it describes. It is stored with the registration, so it must not capture a declaration or a compilation. The delegates given by several calls run in the order of the calls.

Returns
Type Description
IConfiguredTemplateInterception

An IConfiguredTemplateInterception, which only allows further calls of Configure. The other methods of this interface must therefore be called before this method, because they determine the signature that the delegate receives.

Exceptions
Type Condition
ArgumentNullException

configure is null.