Table of Contents

Class ReflectionUtils

Namespace
Common
Assembly
Lykke.Common.dll
public static class ReflectionUtils
Inheritance
ReflectionUtils
Inherited Members

Methods

CreateDefault(Type)

public static object CreateDefault(this Type type)

Parameters

type Type

Returns

object

CreateUsingDefaultConstructor(Type)

public static object CreateUsingDefaultConstructor(this Type type)

Parameters

type Type

Returns

object

DoesThePropertyImplementTheInterface(Type, Type)

public static bool DoesThePropertyImplementTheInterface(Type propertyType, Type interfaceType)

Parameters

propertyType Type
interfaceType Type

Returns

bool

FindConstructor(Type, Type)

public static ConstructorInfo FindConstructor(Type type, Type param0)

Parameters

type Type
param0 Type

Returns

ConstructorInfo

FindDefaultConstructor(Type)

public static ConstructorInfo FindDefaultConstructor(this Type type)

Parameters

type Type

Returns

ConstructorInfo

FindProperiesWithAttribute(Type, Type)

public static IEnumerable<PropertyAttributePair> FindProperiesWithAttribute(Type type, Type attr)

Parameters

type Type
attr Type

Returns

IEnumerable<PropertyAttributePair>

FindProperiesWithAttribute<TAttr>(Type)

public static IEnumerable<PropertyAttributePair<TAttr>> FindProperiesWithAttribute<TAttr>(Type type) where TAttr : Attribute

Parameters

type Type

Returns

IEnumerable<PropertyAttributePair<TAttr>>

Type Parameters

TAttr

FindProperty(Type, string)

public static PropertyInfo FindProperty(Type type, string propertyName)

Parameters

type Type
propertyName string

Returns

PropertyInfo

FindPropertyByName(Type, string)

public static PropertyInfo FindPropertyByName(Type type, string name)

Parameters

type Type
name string

Returns

PropertyInfo

FindPropertyByName(Type, string, out string[])

public static PropertyInfo FindPropertyByName(Type type, string name, out string[] propertyPath)

Parameters

type Type
name string
propertyPath string[]

Returns

PropertyInfo

GetAssemblyVersion()

public static string GetAssemblyVersion()

Returns

string

GetAttribute(MethodInfo, Type)

public static object GetAttribute(MethodInfo methodInfo, Type attr)

Parameters

methodInfo MethodInfo
attr Type

Returns

object

GetAttribute(PropertyInfo, Type)

public static object GetAttribute(PropertyInfo propertyInfo, Type attr)

Parameters

propertyInfo PropertyInfo
attr Type

Returns

object

GetAttribute<TAttr>(object)

public static TAttr GetAttribute<TAttr>(object instance) where TAttr : Attribute

Parameters

instance object

Returns

TAttr

Type Parameters

TAttr

GetAttribute<TAttr>(MethodInfo)

public static TAttr GetAttribute<TAttr>(MethodInfo methodInfo) where TAttr : Attribute

Parameters

methodInfo MethodInfo

Returns

TAttr

Type Parameters

TAttr

GetAttribute<TAttr>(PropertyInfo)

public static TAttr GetAttribute<TAttr>(PropertyInfo propertyInfo) where TAttr : Attribute

Parameters

propertyInfo PropertyInfo

Returns

TAttr

Type Parameters

TAttr

GetAttribute<TAttr>(Type)

public static TAttr GetAttribute<TAttr>(Type type) where TAttr : Attribute

Parameters

type Type

Returns

TAttr

Type Parameters

TAttr

GetClassesWhichImplementsInterface<TMyInterface>(Assembly, TMyInterface)

public static IEnumerable<TMyInterface> GetClassesWhichImplementsInterface<TMyInterface>(this Assembly assembly, TMyInterface interfaceType)

Parameters

assembly Assembly
interfaceType TMyInterface

Returns

IEnumerable<TMyInterface>

Type Parameters

TMyInterface

GetEnumNames<T>()

public static IEnumerable<string> GetEnumNames<T>()

Returns

IEnumerable<string>

Type Parameters

T

GetMethods<TAttr>(object)

public static IEnumerable<MethodAttribytePair<TAttr>> GetMethods<TAttr>(object instance) where TAttr : Attribute

Parameters

instance object

Returns

IEnumerable<MethodAttribytePair<TAttr>>

Type Parameters

TAttr

GetMethods<TAttr>(Type)

public static IEnumerable<MethodAttribytePair<TAttr>> GetMethods<TAttr>(Type type) where TAttr : Attribute

Parameters

type Type

Returns

IEnumerable<MethodAttribytePair<TAttr>>

Type Parameters

TAttr

GetNullableGenericType(Type)

public static Type GetNullableGenericType(Type type)

Parameters

type Type

Returns

Type

IsNullableType(Type)

public static bool IsNullableType(Type type)

Parameters

type Type

Returns

bool

IsSimpleType(Type)

public static bool IsSimpleType(Type type)

Parameters

type Type

Returns

bool

PopulateObject(object, Func<PropertyInfo, object>)

public static void PopulateObject(this object data, Func<PropertyInfo, object> getValue)

Parameters

data object
getValue Func<PropertyInfo, object>