Open sandboxFocus

Method WithGranularity

WithGranularity(InterceptorGranularity)

Sets what the template depends on, and therefore which call sites share the synthesized method. The default value is Global.

Declaration
ITemplateInterception WithGranularity(InterceptorGranularity granularity)
Parameters
Type Name Description
InterceptorGranularity granularity

The granularity.

Returns
Type Description
ITemplateInterception
Remarks

The engine does not detect what the template depends on. When several call sites share the method, the template is expanded once, for the representative call site and with its aspect instance, as described in InterceptorGranularity. A template that depends on the state of its aspect instance must include Owner.