When overridden in a derived class, returns the public or non-public get accessor for this property.
A MethodInfo object representing the get accessor for this property, if nonPublic is true. Returns null if nonPublic is false and the get accessor is non-public, or if nonPublic is true but no get accessors exist.
Type Reason MethodAccessException nonPublic is true, the Get accessor for the property reflected by the current instance is non-public, and the caller does not have System.Security.Permissions.ReflectionPermission to reflect on non-public methods.
This property is the System.Reflection.MethodInfo representing the get accessor.
To use the GetGetMethod method, first get the class Type. From the Type, get the System.Reflection.PropertyInfo. From the System.Reflection.PropertyInfo, use the GetGetMethod method.
Type | Reason |
---|---|
System.Security.Permissions.ReflectionPermission | Requires permission to reflect non-public members of a type in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation. |