Open sandboxFocus

Method PlaceInType

PlaceInType(INamedType)

Synthesizes the method in a given type of the current project.

Declaration
ITemplateInterception PlaceInType(INamedType type)
Parameters
Type Name Description
INamedType type

The type. It must be accessible from the call sites.

Returns
Type Description
ITemplateInterception
Remarks

The method is private when the type contains the call site, private protected when the type is a base type of the calling type, and internal otherwise. The type does not need to be partial.

A call site that cannot use the type is reported as LAMA1024. In ForEachSite(Func<IMethodInterceptionSite, IMethodInterception>), use CanPlaceInType(INamedType) to choose another placement for such a site.

Exceptions
Type Condition
ArgumentNullException

type is null.

PlaceInType(Type)

Synthesizes the method in a given type of the current project.

Declaration
ITemplateInterception PlaceInType(Type type)
Parameters
Type Name Description
Type type

The type. It must be accessible from the call sites.

Returns
Type Description
ITemplateInterception
Remarks
Exceptions
Type Condition
ArgumentNullException

type is null.