TypeExtensions class
Contains extensions for PropertyInfo class
Namespace: TypeLite.Extensions
Methods
Name | Description | |
---|---|---|
GetCustomAttribute<TType> | Retrieves a custom attribute of a specified type that is applied to a specified type. | |
GetNullableValueType | Retrieves underlaying value type of the nullable value type. | |
IsNullable | Determined whether the specific type is nullable value type. |
TypeExtensions.GetCustomAttribute<TType> method
Retrieves a custom attribute of a specified type that is applied to a specified type.
Syntax
Parameters
-
Type
type - The type to inspect.
-
bool
inherit - true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.
Returns
-
TType
- A custom attribute that matches T, or null if no such attribute is found.
TypeExtensions.GetNullableValueType method
Retrieves underlaying value type of the nullable value type.
Syntax
Parameters
-
Type
type - The type to inspect.
Returns
-
Type
- The underlaying value type.
TypeExtensions.IsNullable method
Determined whether the specific type is nullable value type.
Syntax
Parameters
-
Type
type - The type to inspect.
Returns
-
bool
- true if the type is nullable value type otherwise false