Chooses how the selected calls are intercepted by a result that applies to every call site: redirected to an existing method, or redirected to a method synthesized from a template. It is the base of IMethodSelection.
Namespace: Metalama.Extensions.Interceptors
Assembly: Metalama.Extensions.Interceptors.dll
Syntax
[CompileTime]
[InternalImplement]
public interface IMethodRegistrationFactoryRemarks
A result created by this interface is a registration, which is kept across compilations. Its arguments must therefore be durable, and they are resolved in the compilation of each call site. IMethodResultFactory is the counterpart of this interface for the result of one call site, in the delegate given to ForEachSite(Func<IMethodInterceptionSite, IMethodInterception>), whose arguments can be any code model value.
Methods
| Name | Description |
|---|---|
| RedirectToExistingMethod(IMethod) | Redirects the calls to an existing method. |
| RedirectToSynthesizedMethod(in MethodTemplateSelector) | Redirects the calls to a method synthesized from a template given as a MethodTemplateSelector. |
| RedirectToSynthesizedMethod(DurableTemplateInvocation) | Redirects the calls to a method synthesized from a template given as a DurableTemplateInvocation, which also gives the arguments and the template provider. |
| RedirectToSynthesizedMethod(string) | Redirects the calls to a method synthesized from the template of the given name. |