InjectionTargetInfoGetCustomAttributes Method (Type, Boolean)

Simple Injector
Returns an array of custom attributes defined on either the Parameter or the Property, identified by type, or an empty array if there are no custom attributes of that type.

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 4.0.0
Syntax

public Object[] GetCustomAttributes(
	Type attributeType,
	bool inherit
)

Parameters

attributeType
Type: SystemType
The type of the custom attributes.
inherit
Type: SystemBoolean
When true, look up the hierarchy chain for the inherited custom attribute.

Return Value

Type: Object
An array of Objects representing custom attributes, or an empty array.
Exceptions

ExceptionCondition
TypeLoadExceptionThe custom attribute type cannot be loaded.
ArgumentNullExceptionattributeType is null.
See Also

Reference