Skip to content

M_CodeJam_Mapping_MappingSchema_GetAttributes__1_1

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

MappingSchema.GetAttributes(T) Method (MemberInfo, Func(T, String), Boolean)

Returns custom attributes applied to provided type member.

Namespace: CodeJam.Mapping
Assembly: CodeJam.Blocks (in CodeJam.Blocks.dll) Version: 2.0.0.0

Syntax

C#

public T[] GetAttributes<T>(
	MemberInfo memberInfo,
	Func<T, string> configGetter,
	bool inherit = true
)
where T : Attribute

VB

Public Function GetAttributes(Of T As Attribute) ( 
	memberInfo As MemberInfo,
	configGetter As Func(Of T, String),
	Optional inherit As Boolean = true
) As T()

F#

member GetAttributes : 
        memberInfo : MemberInfo * 
        configGetter : Func<'T, string> * 
        ?inherit : bool 
(* Defaults:
        let _inherit = defaultArg inherit true
*)
-> 'T[]  when 'T : Attribute

Parameters

 

memberInfo
Type: System.Reflection.MemberInfo
Type member.
configGetter
Type: System.Func(T, String)
A function that returns configuration value is supported by the attribute.
inherit (Optional)
Type: System.Boolean
true to search this member's inheritance chain to find the attributes; otherwise, false.

Type Parameters

 

T
The type of attribute to search for. Only attributes that are assignable to this member are returned.

Return Value

Type: T[]
Array of custom attributes.

See Also

Reference

MappingSchema Class
GetAttributes Overload
CodeJam.Mapping Namespace

Clone this wiki locally