MemberAdapterRepository.GetMethodMetadata Method

Namespace
Kampute.DocToolkit.Metadata.Adapters
Assembly
  • Kampute.DocToolkit.dll

Definition

Gets the method metadata for the specified method within the assembly.
public virtual IMethodBase GetMethodMetadata(MethodInfo methodInfo, bool asDeclared = false)

Parameters

methodInfo MethodInfo
The reflection method to get metadata for.
asDeclared bool optional
Indicates whether to retrieve extension methods in their declared form rather than their usage form.

Returns

IMethodBase
A metadata representation of the specified method.

Exceptions

ArgumentNullException
Thrown when methodInfo is null.
ArgumentException
Thrown when methodInfo does not belong to the assembly.

Remarks

When asDeclared is false (the default), extension methods are detected and resolved to reflect their usage form rather than their declared form. Otherwise, the metadata is retrieved as declared, without extension method detection and resolution.

Based on the nature of the provided methodInfo, the returned metadata may represent different method types:

  • Regular or Extension MethodThe returned metadata is an instance of IMethod.
  • Operator OverloadThe returned metadata is an instance of IOperator.