Class Helpers
Shortcut Methods, mostly focused on getting attributes from class properties and enums.
public static class Helpers
- Inheritance
-
Helpers
- Inherited Members
Methods
GetCustomAttribute<T>(object)
Returns a cast Custom Attribute from a given object.
public static T GetCustomAttribute<T>(object obj) where T : Attribute
Parameters
obj
object
Returns
- T
Type Parameters
T
GetCustomAttribute<T>(Type)
Returns a cast Custom Attribute from a given type.
public static T GetCustomAttribute<T>(Type type) where T : Attribute
Parameters
type
Type
Returns
- T
Type Parameters
T
GetMappedToAttr(Enum)
Shortcut method for accessing a MapTo
attribute, combined with an Enum.
public static MapToAttribute GetMappedToAttr(Enum obj)
Parameters
obj
Enum
Returns
GetPropertyValue<T>(object, string)
Returns the current value from a given class property
public static T GetPropertyValue<T>(object obj, string propName)
Parameters
Returns
- T
Type Parameters
T