Open sandboxFocus

Method PlaceInCallingType

PlaceInCallingType()

Synthesizes the method in the innermost type that contains the call site.

Declaration
ITemplateInterception PlaceInCallingType()
Returns
Type Description
ITemplateInterception
Remarks

The method is private. The type does not need to be partial.

The method is static by default. When the intercepted method is a protected method of a base type of the calling type, the method is an instance method without a receiver parameter: the call site calls it on its receiver, and meta.Proceed() calls the intercepted method on this. A delegate given to Configure(Action<IInterceptorMethodBuilder>) can choose this form for other methods. See This.

A call site in top-level statements cannot use this placement, because the type that contains it is implicit. A call site that cannot use it is reported as LAMA1024. In ForEachSite(Func<IMethodInterceptionSite, IMethodInterception>), use CanPlaceInCallingType to choose another placement for such a site.