IMemberAdapterRepository.GetMethodMetadata Method
- Namespace
- Kampute.DocToolkit.Metadata
- Assembly
- Kampute.DocToolkit.dll
| IMemberAdapterRepository.GetMethodMetadata(MethodInfo, bool) | Gets the method metadata for the specified method within the assembly. |
| IMemberAdapterRepository.GetMethodMetadata<T>(MethodInfo) | Gets the method metadata for the specified method within the assembly, with a specific return type. |
IMemberAdapterRepository.GetMethodMetadata(MethodInfo, bool)
Gets the method metadata for the specified method within the assembly.
IMethodBase GetMethodMetadata(MethodInfo methodInfo, bool asDeclared = false)Parameters
methodInfoMethodInfo- The reflection method to get metadata for.
asDeclaredbool 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
methodInfoisnull. - ArgumentException
- Thrown when
methodInfodoes not belong to the assembly.
Remarks
IMemberAdapterRepository.GetMethodMetadata<T>(MethodInfo)
Gets the method metadata for the specified method within the assembly, with a specific return type.
T GetMethodMetadata<T>(MethodInfo methodInfo)
where T : IMethodBaseThis method has a default implementation in the interface.
Type Parameters
T- The specific type of method metadata to retrieve.
Parameters
methodInfoMethodInfo- The reflection method to get metadata for.
Returns
- T
- A metadata representation of the specified method.
Exceptions
- ArgumentNullException
- Thrown when
methodInfoisnull. - ArgumentException
- Thrown when
methodInfodoes not belong to the assembly. - InvalidCastException
- Thrown when the retrieved method metadata cannot be cast to
T.
Remarks
Unlike IMemberAdapterRepository.GetMethodMetadata(MethodInfo, bool), this method always retrieves the method metadata in its resolved form, meaning that extension methods are detected and resolved to reflect their usage form rather than their declared form.

asDeclaredisfalse(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: