Interface
MethodInfo
sealed interface MethodInfo
Module: System.Introspection
Assembly: System.Runtime.dll
Source file: Descriptors.rvn
Inherits: MemberInfo
Closed hierarchy: only the permitted direct subtypes can extend this type.
Permitted direct subtypes: RuntimeMethodInfo
Part of closed hierarchy: MemberInfo
Describes a retained method declaration in the loaded program.
Remarks
Development after Preview 9. Object equality uses descriptor kind, closed declaring type and definition index. Repeated wrappers can compare equal; Object hashes agree and ToString returns Name, not a complete signature. This API describes metadata and does not invoke, read or write application members. See the introspection guide for query and identity limitations.
Properties
19 items
ContainsGenericParameters: bool
True when this method or its declaring type contains unbound parameters.
Defined by MethodInfo.ContainsGenericParameters · Required implementation (no default).
DeclaringType: Optional<TypeInfo>
Gets the declaring type, or None for a top-level member.
Inherited from MemberInfo.DeclaringType · Defined by MemberInfo.DeclaringType · Required implementation (no default).
DefinitionIndex: Optional<int>
Gets the loaded declaration index, or None for synthesized Function members.
Defined by MethodInfo.DefinitionIndex · Required implementation (no default).
FunctionType: TypeInfo
Structural signature or a function-constrained parameter for an open method.
Defined by MethodInfo.FunctionType · Required implementation (no default).
IsAbstract: bool
Reports a bodyless method or interface contract.
Defined by MethodInfo.IsAbstract · Required implementation (no default).
IsAssembly: bool
Reports internal (assembly) visibility.
Defined by MethodInfo.IsAssembly · Required implementation (no default).
IsGenericMethod: bool
True for a generic method definition or a constructed generic method.
Defined by MethodInfo.IsGenericMethod · Required implementation (no default).
IsGenericMethodDefinition: bool
True when the method's own generic arguments remain its declared parameters.
Defined by MethodInfo.IsGenericMethodDefinition · Required implementation (no default).
IsOverride: bool
Reports an override declaration.
Defined by MethodInfo.IsOverride · Required implementation (no default).
IsPrivate: bool
Reports private visibility.
Defined by MethodInfo.IsPrivate · Required implementation (no default).
IsPublic: bool
Reports public visibility.
Defined by MethodInfo.IsPublic · Required implementation (no default).
IsReadOnly: bool
Reports a read-only instance receiver.
Defined by MethodInfo.IsReadOnly · Required implementation (no default).
IsReceiverByRef: bool
Reports whether the instance receiver is passed by reference.
Defined by MethodInfo.IsReceiverByRef · Required implementation (no default).
IsStatic: bool
Reports whether the method is static.
Defined by MethodInfo.IsStatic · Required implementation (no default).
IsVirtual: bool
Reports a virtual method or interface dispatch contract. Ordinary static interface helpers are not virtual.
Defined by MethodInfo.IsVirtual · Required implementation (no default).
MetadataToken: Optional<int>
Gets Some(token) for available declaration metadata, or None for a synthesized member. Tokens are scoped to their defining module.
Inherited from MemberInfo.MetadataToken · Defined by MemberInfo.MetadataToken · Required implementation (no default).
Module: Optional<ModuleInfo>
Gets Some(module) for a declared member, or None when no defining module exists.
Inherited from MemberInfo.Module · Defined by MemberInfo.Module · Required implementation (no default).
Name: string
Gets the declared or synthesized member name.
Inherited from MemberInfo.Name · Defined by MemberInfo.Name · Required implementation (no default).
ReturnType: TypeInfo
Gets the method return type with declaring-type generic arguments substituted.
Defined by MethodInfo.ReturnType · Required implementation (no default).
Methods
3 items
GetCustomAttributesData() -> Sequence<CustomAttributeData>
Gets directly declared retained attribute data without executing attribute constructors.
Inherited from MemberInfo.GetCustomAttributesData · Defined by MemberInfo.GetCustomAttributesData · Required implementation (no default).
GetParameters() -> Sequence<ParameterInfo>
Gets parameters in signature order.
Defined by MethodInfo.GetParameters · Required implementation (no default).
Extension member:
Invoke(receiver: object?, arguments: ...object?[]) -> Result<object?, ReflectionError>
Invokes a described public IL method.
Extension from MethodReflectionExtensions.Invoke