Skip to main content

PlatformExtensions

Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class PlatformExtensions

Methods

IsInterface(Type)

View Source
Declaration
[Obsolete("Use type.IsInterface")]
public static bool IsInterface(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsArray(Type)

View Source
Declaration
[Obsolete("Use type.IsArray")]
public static bool IsArray(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsValueType(Type)

View Source
Declaration
[Obsolete("Use type.IsValueType")]
public static bool IsValueType(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsGeneric(Type)

View Source
Declaration
[Obsolete("Use type.IsGenericType")]
public static bool IsGeneric(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

BaseType(Type)

View Source
Declaration
[Obsolete("Use type.BaseType")]
public static Type BaseType(this Type type)
Returns

System.Type

Parameters
TypeName
System.Typetype

ReflectedType(PropertyInfo)

View Source
Declaration
[Obsolete("Use pi.ReflectedType")]
public static Type ReflectedType(this PropertyInfo pi)
Returns

System.Type

Parameters
TypeName
System.Reflection.PropertyInfopi

ReflectedType(FieldInfo)

View Source
Declaration
[Obsolete("Use fi.ReflectedType")]
public static Type ReflectedType(this FieldInfo fi)
Returns

System.Type

Parameters
TypeName
System.Reflection.FieldInfofi

GenericTypeDefinition(Type)

View Source
Declaration
[Obsolete("Use type.GetGenericTypeDefinition()")]
public static Type GenericTypeDefinition(this Type type)
Returns

System.Type

Parameters
TypeName
System.Typetype

GetTypeInterfaces(Type)

View Source
Declaration
[Obsolete("Use type.GetInterfaces()")]
public static Type[] GetTypeInterfaces(this Type type)
Returns

System.Type[]

Parameters
TypeName
System.Typetype

GetTypeGenericArguments(Type)

View Source
Declaration
[Obsolete("Use type.GetGenericArguments()")]
public static Type[] GetTypeGenericArguments(this Type type)
Returns

System.Type[]

Parameters
TypeName
System.Typetype

GetEmptyConstructor(Type)

View Source
Declaration
[Obsolete("Use type.GetConstructor(Type.EmptyTypes)")]
public static ConstructorInfo GetEmptyConstructor(this Type type)
Returns

System.Reflection.ConstructorInfo

Parameters
TypeName
System.Typetype

GetAllConstructors(Type)

View Source
Declaration
[Obsolete("Use type.GetConstructors()")]
public static IEnumerable<ConstructorInfo> GetAllConstructors(this Type type)
Returns

System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo>

Parameters
TypeName
System.Typetype

GetAssembly(Type)

View Source
Declaration
[Obsolete("Use type.Assembly")]
public static Assembly GetAssembly(this Type type)
Returns

System.Reflection.Assembly

Parameters
TypeName
System.Typetype

Fields(Type)

View Source
Declaration
public static FieldInfo[] Fields(this Type type)
Returns

System.Reflection.FieldInfo[]

Parameters
TypeName
System.Typetype

Properties(Type)

View Source
Declaration
public static PropertyInfo[] Properties(this Type type)
Returns

System.Reflection.PropertyInfo[]

Parameters
TypeName
System.Typetype

GetAllFields(Type)

View Source
Declaration
public static FieldInfo[] GetAllFields(this Type type)
Returns

System.Reflection.FieldInfo[]

Parameters
TypeName
System.Typetype

GetPublicFields(Type)

View Source
Declaration
public static FieldInfo[] GetPublicFields(this Type type)
Returns

System.Reflection.FieldInfo[]

Parameters
TypeName
System.Typetype

GetPublicMembers(Type)

View Source
Declaration
public static MemberInfo[] GetPublicMembers(this Type type)
Returns

System.Reflection.MemberInfo[]

Parameters
TypeName
System.Typetype

GetAllPublicMembers(Type)

View Source
Declaration
public static MemberInfo[] GetAllPublicMembers(this Type type)
Returns

System.Reflection.MemberInfo[]

Parameters
TypeName
System.Typetype

GetStaticMethod(Type, String)

View Source
Declaration
public static MethodInfo GetStaticMethod(this Type type, string methodName)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Typetype
System.StringmethodName

GetInstanceMethod(Type, String)

View Source
Declaration
public static MethodInfo GetInstanceMethod(this Type type, string methodName)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Typetype
System.StringmethodName

Method(Delegate)

View Source
Declaration
[Obsolete("Use fn.Method")]
public static MethodInfo Method(this Delegate fn)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Delegatefn

HasAttribute<T>(Type)

View Source
Declaration
public static bool HasAttribute<T>(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype
Type Parameters
  • T

HasAttributeOf<T>(Type)

View Source
Declaration
public static bool HasAttributeOf<T>(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype
Type Parameters
  • T

HasAttribute<T>(PropertyInfo)

View Source
Declaration
public static bool HasAttribute<T>(this PropertyInfo pi)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.PropertyInfopi
Type Parameters
  • T

HasAttributeOf<T>(PropertyInfo)

View Source
Declaration
public static bool HasAttributeOf<T>(this PropertyInfo pi)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.PropertyInfopi
Type Parameters
  • T

HasAttribute<T>(FieldInfo)

View Source
Declaration
public static bool HasAttribute<T>(this FieldInfo fi)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.FieldInfofi
Type Parameters
  • T

HasAttributeOf<T>(FieldInfo)

View Source
Declaration
public static bool HasAttributeOf<T>(this FieldInfo fi)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.FieldInfofi
Type Parameters
  • T

HasAttribute<T>(MethodInfo)

View Source
Declaration
public static bool HasAttribute<T>(this MethodInfo mi)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.MethodInfomi
Type Parameters
  • T

HasAttributeOf<T>(MethodInfo)

View Source
Declaration
public static bool HasAttributeOf<T>(this MethodInfo mi)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.MethodInfomi
Type Parameters
  • T

HasAttributeCached<T>(MemberInfo)

View Source
Declaration
public static bool HasAttributeCached<T>(this MemberInfo memberInfo)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.MemberInfomemberInfo
Type Parameters
  • T

HasAttributeOfCached<T>(MemberInfo)

View Source
Declaration
public static bool HasAttributeOfCached<T>(this MemberInfo memberInfo)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.MemberInfomemberInfo
Type Parameters
  • T

HasAttributeNamed(Type, String)

View Source
Declaration
public static bool HasAttributeNamed(this Type type, string name)
Returns

System.Boolean

Parameters
TypeName
System.Typetype
System.Stringname

HasAttributeNamed(PropertyInfo, String)

View Source
Declaration
public static bool HasAttributeNamed(this PropertyInfo pi, string name)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.PropertyInfopi
System.Stringname

HasAttributeNamed(FieldInfo, String)

View Source
Declaration
public static bool HasAttributeNamed(this FieldInfo fi, string name)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.FieldInfofi
System.Stringname

HasAttributeNamed(MemberInfo, String)

View Source
Declaration
public static bool HasAttributeNamed(this MemberInfo mi, string name)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.MemberInfomi
System.Stringname

IsDto(Type)

View Source
Declaration
public static bool IsDto(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

PropertyGetMethod(PropertyInfo, Boolean)

View Source
Declaration
[Obsolete("Use pi.GetGetMethod(nonPublic)")]
public static MethodInfo PropertyGetMethod(this PropertyInfo pi, bool nonPublic = false)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Reflection.PropertyInfopi
System.BooleannonPublic

Interfaces(Type)

View Source
Declaration
[Obsolete("Use type.GetInterfaces()")]
public static Type[] Interfaces(this Type type)
Returns

System.Type[]

Parameters
TypeName
System.Typetype

AllProperties(Type)

View Source
Declaration
public static PropertyInfo[] AllProperties(this Type type)
Returns

System.Reflection.PropertyInfo[]

Parameters
TypeName
System.Typetype

ClearRuntimeAttributes()

View Source
Declaration
public static void ClearRuntimeAttributes()

AddAttributes(Type, Attribute[])

View Source
Declaration
public static Type AddAttributes(this Type type, params Attribute[] attrs)
Returns

System.Type

Parameters
TypeName
System.Typetype
System.Attribute[]attrs

AddAttributes(PropertyInfo, Attribute[])

Add a Property attribute at runtime. <p>Not threadsafe, should only add attributes on Startup.</p>

View Source
Declaration
public static PropertyInfo AddAttributes(this PropertyInfo propertyInfo, params Attribute[] attrs)
Returns

System.Reflection.PropertyInfo

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo
System.Attribute[]attrs

ReplaceAttribute(PropertyInfo, Attribute)

Add a Property attribute at runtime. <p>Not threadsafe, should only add attributes on Startup.</p>

View Source
Declaration
public static PropertyInfo ReplaceAttribute(this PropertyInfo propertyInfo, Attribute attr)
Returns

System.Reflection.PropertyInfo

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo
System.Attributeattr

GetAttributes<TAttr>(PropertyInfo)

View Source
Declaration
public static List<TAttr> GetAttributes<TAttr>(this PropertyInfo propertyInfo)
Returns

System.Collections.Generic.List<<TAttr>>

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo
Type Parameters
  • TAttr

GetAttributes(PropertyInfo)

View Source
Declaration
public static List<Attribute> GetAttributes(this PropertyInfo propertyInfo)
Returns

System.Collections.Generic.List<System.Attribute>

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo

GetAttributes(PropertyInfo, Type)

View Source
Declaration
public static List<Attribute> GetAttributes(this PropertyInfo propertyInfo, Type attrType)
Returns

System.Collections.Generic.List<System.Attribute>

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo
System.TypeattrType

AllAttributes(PropertyInfo)

View Source
Declaration
public static object[] AllAttributes(this PropertyInfo propertyInfo)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo

AllAttributesLazy(PropertyInfo)

View Source
Declaration
public static IEnumerable<object> AllAttributesLazy(this PropertyInfo propertyInfo)
Returns

System.Collections.Generic.IEnumerable<System.Object>

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo

AllAttributes(PropertyInfo, Type)

View Source
Declaration
public static object[] AllAttributes(this PropertyInfo propertyInfo, Type attrType)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo
System.TypeattrType

AllAttributesLazy(PropertyInfo, Type)

View Source
Declaration
public static IEnumerable<object> AllAttributesLazy(this PropertyInfo propertyInfo, Type attrType)
Returns

System.Collections.Generic.IEnumerable<System.Object>

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo
System.TypeattrType

AllAttributes(ParameterInfo)

View Source
Declaration
public static object[] AllAttributes(this ParameterInfo paramInfo)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.ParameterInfoparamInfo

AllAttributes(FieldInfo)

View Source
Declaration
public static object[] AllAttributes(this FieldInfo fieldInfo)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.FieldInfofieldInfo

AllAttributes(MemberInfo)

View Source
Declaration
public static object[] AllAttributes(this MemberInfo memberInfo)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.MemberInfomemberInfo

AllAttributes(ParameterInfo, Type)

View Source
Declaration
public static object[] AllAttributes(this ParameterInfo paramInfo, Type attrType)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.ParameterInfoparamInfo
System.TypeattrType

AllAttributes(MemberInfo, Type)

View Source
Declaration
public static object[] AllAttributes(this MemberInfo memberInfo, Type attrType)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.MemberInfomemberInfo
System.TypeattrType

AllAttributes(FieldInfo, Type)

View Source
Declaration
public static object[] AllAttributes(this FieldInfo fieldInfo, Type attrType)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.FieldInfofieldInfo
System.TypeattrType

AllAttributes(Type)

View Source
Declaration
public static object[] AllAttributes(this Type type)
Returns

System.Object[]

Parameters
TypeName
System.Typetype

AllAttributesLazy(Type)

View Source
Declaration
public static IEnumerable<object> AllAttributesLazy(this Type type)
Returns

System.Collections.Generic.IEnumerable<System.Object>

Parameters
TypeName
System.Typetype

AllAttributes(Type, Type)

View Source
Declaration
public static object[] AllAttributes(this Type type, Type attrType)
Returns

System.Object[]

Parameters
TypeName
System.Typetype
System.TypeattrType

AllAttributes(Assembly)

View Source
Declaration
public static object[] AllAttributes(this Assembly assembly)
Returns

System.Object[]

Parameters
TypeName
System.Reflection.Assemblyassembly

AllAttributes<TAttr>(ParameterInfo)

View Source
Declaration
public static TAttr[] AllAttributes<TAttr>(this ParameterInfo pi)
Returns

<TAttr>[]

Parameters
TypeName
System.Reflection.ParameterInfopi
Type Parameters
  • TAttr

AllAttributes<TAttr>(MemberInfo)

View Source
Declaration
public static TAttr[] AllAttributes<TAttr>(this MemberInfo mi)
Returns

<TAttr>[]

Parameters
TypeName
System.Reflection.MemberInfomi
Type Parameters
  • TAttr

AllAttributes<TAttr>(FieldInfo)

View Source
Declaration
public static TAttr[] AllAttributes<TAttr>(this FieldInfo fi)
Returns

<TAttr>[]

Parameters
TypeName
System.Reflection.FieldInfofi
Type Parameters
  • TAttr

AllAttributes<TAttr>(PropertyInfo)

View Source
Declaration
public static TAttr[] AllAttributes<TAttr>(this PropertyInfo pi)
Returns

<TAttr>[]

Parameters
TypeName
System.Reflection.PropertyInfopi
Type Parameters
  • TAttr

AllAttributesLazy<TAttr>(PropertyInfo)

View Source
Declaration
public static IEnumerable<TAttr> AllAttributesLazy<TAttr>(this PropertyInfo pi)
Returns

System.Collections.Generic.IEnumerable<<TAttr>>

Parameters
TypeName
System.Reflection.PropertyInfopi
Type Parameters
  • TAttr

AllAttributes<TAttr>(Type)

View Source
Declaration
public static TAttr[] AllAttributes<TAttr>(this Type type)
Returns

<TAttr>[]

Parameters
TypeName
System.Typetype
Type Parameters
  • TAttr

AllAttributesLazy<TAttr>(Type)

View Source
Declaration
public static IEnumerable<TAttr> AllAttributesLazy<TAttr>(this Type type)
Returns

System.Collections.Generic.IEnumerable<<TAttr>>

Parameters
TypeName
System.Typetype
Type Parameters
  • TAttr

FirstAttribute<TAttr>(Type)

View Source
Declaration
public static TAttr FirstAttribute<TAttr>(this Type type)
where TAttr : class
Returns

<TAttr>

Parameters
TypeName
System.Typetype
Type Parameters
  • TAttr

FirstAttribute<TAttribute>(MemberInfo)

View Source
Declaration
public static TAttribute FirstAttribute<TAttribute>(this MemberInfo memberInfo)
Returns

<TAttribute>

Parameters
TypeName
System.Reflection.MemberInfomemberInfo
Type Parameters
  • TAttribute

FirstAttribute<TAttribute>(ParameterInfo)

View Source
Declaration
public static TAttribute FirstAttribute<TAttribute>(this ParameterInfo paramInfo)
Returns

<TAttribute>

Parameters
TypeName
System.Reflection.ParameterInfoparamInfo
Type Parameters
  • TAttribute

FirstAttribute<TAttribute>(PropertyInfo)

View Source
Declaration
public static TAttribute FirstAttribute<TAttribute>(this PropertyInfo propertyInfo)
Returns

<TAttribute>

Parameters
TypeName
System.Reflection.PropertyInfopropertyInfo
Type Parameters
  • TAttribute

FirstGenericTypeDefinition(Type)

View Source
Declaration
public static Type FirstGenericTypeDefinition(this Type type)
Returns

System.Type

Parameters
TypeName
System.Typetype

IsDynamic(Assembly)

View Source
Declaration
public static bool IsDynamic(this Assembly assembly)
Returns

System.Boolean

Parameters
TypeName
System.Reflection.Assemblyassembly

GetStaticMethod(Type, String, Type[])

View Source
Declaration
public static MethodInfo GetStaticMethod(this Type type, string methodName, Type[] types)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Typetype
System.StringmethodName
System.Type[]types

GetMethodInfo(Type, String, Type[])

View Source
Declaration
public static MethodInfo GetMethodInfo(this Type type, string methodName, Type[] types = null)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Typetype
System.StringmethodName
System.Type[]types

InvokeMethod(Delegate, Object, Object[])

View Source
Declaration
public static object InvokeMethod(this Delegate fn, object instance, object[] parameters = null)
Returns

System.Object

Parameters
TypeName
System.Delegatefn
System.Objectinstance
System.Object[]parameters

GetPublicStaticField(Type, String)

View Source
Declaration
public static FieldInfo GetPublicStaticField(this Type type, string fieldName)
Returns

System.Reflection.FieldInfo

Parameters
TypeName
System.Typetype
System.StringfieldName

MakeDelegate(MethodInfo, Type, Boolean)

View Source
Declaration
public static Delegate MakeDelegate(this MethodInfo mi, Type delegateType, bool throwOnBindFailure = true)
Returns

System.Delegate

Parameters
TypeName
System.Reflection.MethodInfomi
System.TypedelegateType
System.BooleanthrowOnBindFailure

GenericTypeArguments(Type)

View Source
Declaration
[Obsolete("Use type.GetGenericArguments()")]
public static Type[] GenericTypeArguments(this Type type)
Returns

System.Type[]

Parameters
TypeName
System.Typetype

DeclaredConstructors(Type)

View Source
Declaration
[Obsolete("Use type.GetConstructors()")]
public static ConstructorInfo[] DeclaredConstructors(this Type type)
Returns

System.Reflection.ConstructorInfo[]

Parameters
TypeName
System.Typetype

AssignableFrom(Type, Type)

View Source
Declaration
[Obsolete("Use type.IsAssignableFrom(fromType)")]
public static bool AssignableFrom(this Type type, Type fromType)
Returns

System.Boolean

Parameters
TypeName
System.Typetype
System.TypefromType

IsStandardClass(Type)

View Source
Declaration
public static bool IsStandardClass(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsAbstract(Type)

View Source
Declaration
[Obsolete("Use type.IsAbstract")]
public static bool IsAbstract(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

GetPropertyInfo(Type, String)

View Source
Declaration
[Obsolete("Use type.GetProperty(propertyName)")]
public static PropertyInfo GetPropertyInfo(this Type type, string propertyName)
Returns

System.Reflection.PropertyInfo

Parameters
TypeName
System.Typetype
System.StringpropertyName

GetFieldInfo(Type, String)

View Source
Declaration
[Obsolete("Use type.GetField(fieldName)")]
public static FieldInfo GetFieldInfo(this Type type, string fieldName)
Returns

System.Reflection.FieldInfo

Parameters
TypeName
System.Typetype
System.StringfieldName

GetWritableFields(Type)

View Source
Declaration
public static FieldInfo[] GetWritableFields(this Type type)
Returns

System.Reflection.FieldInfo[]

Parameters
TypeName
System.Typetype

SetMethod(PropertyInfo, Boolean)

View Source
Declaration
[Obsolete("Use pi.GetSetMethod(nonPublic)")]
public static MethodInfo SetMethod(this PropertyInfo pi, bool nonPublic = true)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Reflection.PropertyInfopi
System.BooleannonPublic

GetMethodInfo(PropertyInfo, Boolean)

View Source
Declaration
[Obsolete("Use pi.GetGetMethod(nonPublic)")]
public static MethodInfo GetMethodInfo(this PropertyInfo pi, bool nonPublic = true)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.Reflection.PropertyInfopi
System.BooleannonPublic

InstanceOfType(Type, Object)

View Source
Declaration
[Obsolete("Use type.IsInstanceOfType(instance)")]
public static bool InstanceOfType(this Type type, object instance)
Returns

System.Boolean

Parameters
TypeName
System.Typetype
System.Objectinstance

IsAssignableFromType(Type, Type)

View Source
Declaration
[Obsolete("Use type.IsAssignableFrom(fromType)")]
public static bool IsAssignableFromType(this Type type, Type fromType)
Returns

System.Boolean

Parameters
TypeName
System.Typetype
System.TypefromType

IsClass(Type)

View Source
Declaration
[Obsolete("Use type.IsClass")]
public static bool IsClass(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsEnum(Type)

View Source
Declaration
[Obsolete("Use type.IsEnum")]
public static bool IsEnum(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsEnumFlags(Type)

View Source
Declaration
public static bool IsEnumFlags(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsUnderlyingEnum(Type)

View Source
Declaration
public static bool IsUnderlyingEnum(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

GetInstanceMethods(Type)

View Source
Declaration
public static MethodInfo[] GetInstanceMethods(this Type type)
Returns

System.Reflection.MethodInfo[]

Parameters
TypeName
System.Typetype

GetMethodInfos(Type)

View Source
Declaration
[Obsolete("Use type.GetMethods()")]
public static MethodInfo[] GetMethodInfos(this Type type)
Returns

System.Reflection.MethodInfo[]

Parameters
TypeName
System.Typetype

GetPropertyInfos(Type)

View Source
Declaration
[Obsolete("Use type.GetProperties()")]
public static PropertyInfo[] GetPropertyInfos(this Type type)
Returns

System.Reflection.PropertyInfo[]

Parameters
TypeName
System.Typetype

IsGenericTypeDefinition(Type)

View Source
Declaration
[Obsolete("Use type.IsGenericTypeDefinition")]
public static bool IsGenericTypeDefinition(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsGenericType(Type)

View Source
Declaration
[Obsolete("Use type.IsGenericType")]
public static bool IsGenericType(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

ContainsGenericParameters(Type)

View Source
Declaration
[Obsolete("Use type.ContainsGenericParameters")]
public static bool ContainsGenericParameters(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

GetDeclaringTypeName(Type)

View Source
Declaration
public static string GetDeclaringTypeName(this Type type)
Returns

System.String

Parameters
TypeName
System.Typetype

GetDeclaringTypeName(MemberInfo)

View Source
Declaration
public static string GetDeclaringTypeName(this MemberInfo mi)
Returns

System.String

Parameters
TypeName
System.Reflection.MemberInfomi

CreateDelegate(MethodInfo, Type)

View Source
Declaration
public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType)
Returns

System.Delegate

Parameters
TypeName
System.Reflection.MethodInfomethodInfo
System.TypedelegateType

CreateDelegate(MethodInfo, Type, Object)

View Source
Declaration
public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType, object target)
Returns

System.Delegate

Parameters
TypeName
System.Reflection.MethodInfomethodInfo
System.TypedelegateType
System.Objecttarget

ElementType(Type)

View Source
Declaration
[Obsolete("Use type.GetElementType()")]
public static Type ElementType(this Type type)
Returns

System.Type

Parameters
TypeName
System.Typetype

GetCollectionType(Type)

View Source
Declaration
public static Type GetCollectionType(this Type type)
Returns

System.Type

Parameters
TypeName
System.Typetype

GetCachedGenericType(Type, Type[])

View Source
Declaration
public static Type GetCachedGenericType(this Type type, params Type[] argTypes)
Returns

System.Type

Parameters
TypeName
System.Typetype
System.Type[]argTypes

ToObjectDictionary(Object)

View Source
Declaration
public static Dictionary<string, object> ToObjectDictionary(this object obj)
Returns

System.Collections.Generic.Dictionary<System.String,System.Object>

Parameters
TypeName
System.Objectobj

ToObjectDictionary(Object, Func<String, Object, Object>)

View Source
Declaration
public static Dictionary<string, object> ToObjectDictionary(this object obj, Func<string, object, object> mapper)
Returns

System.Collections.Generic.Dictionary<System.String,System.Object>

Parameters
TypeName
System.Objectobj
System.Func<System.String,System.Object,System.Object>mapper

GetKeyValuePairsTypeDef(Type)

View Source
Declaration
public static Type GetKeyValuePairsTypeDef(this Type dictType)
Returns

System.Type

Parameters
TypeName
System.TypedictType

GetKeyValuePairTypeDef(Type)

View Source
Declaration
public static Type GetKeyValuePairTypeDef(this Type genericEnumType)
Returns

System.Type

Parameters
TypeName
System.TypegenericEnumType

GetKeyValuePairsTypes(Type, out Type, out Type)

View Source
Declaration
public static bool GetKeyValuePairsTypes(this Type dictType, out Type keyType, out Type valueType)
Returns

System.Boolean

Parameters
TypeName
System.TypedictType
System.TypekeyType
System.TypevalueType

GetKeyValuePairsTypes(Type, out Type, out Type, out Type)

View Source
Declaration
public static bool GetKeyValuePairsTypes(this Type dictType, out Type keyType, out Type valueType, out Type kvpType)
Returns

System.Boolean

Parameters
TypeName
System.TypedictType
System.TypekeyType
System.TypevalueType
System.TypekvpType

GetKeyValuePairTypes(Type, out Type, out Type)

View Source
Declaration
public static bool GetKeyValuePairTypes(this Type kvpType, out Type keyType, out Type valueType)
Returns

System.Boolean

Parameters
TypeName
System.TypekvpType
System.TypekeyType
System.TypevalueType

FromObjectDictionary(IEnumerable<KeyValuePair<String, Object>>, Type)

View Source
Declaration
public static object FromObjectDictionary(this IEnumerable<KeyValuePair<string, object>> values, Type type)
Returns

System.Object

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>values
System.Typetype

ShallowClone(IEnumerable)

View Source
Declaration
public static IEnumerable ShallowClone(this IEnumerable xs)
Returns

System.Collections.IEnumerable

Parameters
TypeName
System.Collections.IEnumerablexs

ConvertToObject<T>(T)

View Source
Declaration
public static object ConvertToObject<T>(T value)
Returns

System.Object

Parameters
TypeName
<T>value
Type Parameters
  • T

ConvertFromObject<T>(Object)

View Source
Declaration
public static T ConvertFromObject<T>(object value)
Returns

<T>

Parameters
TypeName
System.Objectvalue
Type Parameters
  • T

PopulateInstance(IEnumerable<KeyValuePair<String, Object>>, Object)

View Source
Declaration
public static void PopulateInstance(this IEnumerable<KeyValuePair<string, object>> values, object instance)
Parameters
TypeName
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>values
System.Objectinstance

PopulateInstance(IEnumerable<KeyValuePair<String, String>>, Object)

View Source
Declaration
public static void PopulateInstance(this IEnumerable<KeyValuePair<string, string>> values, object instance)
Parameters
TypeName
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.String>>values
System.Objectinstance

FromObjectDictionary<T>(IEnumerable<KeyValuePair<String, Object>>)

View Source
Declaration
public static T FromObjectDictionary<T>(this IEnumerable<KeyValuePair<string, object>> values)
Returns

<T>

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>values
Type Parameters
  • T

ToSafePartialObjectDictionary<T>(T)

View Source
Declaration
public static Dictionary<string, object> ToSafePartialObjectDictionary<T>(this T instance)
Returns

System.Collections.Generic.Dictionary<System.String,System.Object>

Parameters
TypeName
<T>instance
Type Parameters
  • T

MergeIntoObjectDictionary(Object, Object[])

View Source
Declaration
public static Dictionary<string, object> MergeIntoObjectDictionary(this object obj, params object[] sources)
Returns

System.Collections.Generic.Dictionary<System.String,System.Object>

Parameters
TypeName
System.Objectobj
System.Object[]sources

ToStringDictionary(IEnumerable<KeyValuePair<String, Object>>)

View Source
Declaration
public static Dictionary<string, string> ToStringDictionary(this IEnumerable<KeyValuePair<string, object>> from)
Returns

System.Collections.Generic.Dictionary<System.String,System.String>

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>from

ToStringDictionary(IEnumerable<KeyValuePair<String, Object>>, IEqualityComparer<String>)

View Source
Declaration
public static Dictionary<string, string> ToStringDictionary(this IEnumerable<KeyValuePair<string, object>> from, IEqualityComparer<string> comparer)
Returns

System.Collections.Generic.Dictionary<System.String,System.String>

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>from
System.Collections.Generic.IEqualityComparer<System.String>comparer

IsNotNullable(PropertyInfo)

Check if #nullable enabled reference type is non nullable

View Source
Declaration
public static bool? IsNotNullable(this PropertyInfo property)
Returns

System.Nullable<System.Boolean>: true if #nullable enabled reference type, false if optional, null if value Type or #nullable not enabled

Parameters
TypeName
System.Reflection.PropertyInfoproperty

IsNotNullable(Type, MemberInfo, IEnumerable<CustomAttributeData>)

Check if #nullable enabled reference type is non nullable

View Source
Declaration
public static bool? IsNotNullable(Type memberType, MemberInfo declaringType, IEnumerable<CustomAttributeData> customAttributes)
Returns

System.Nullable<System.Boolean>: true if #nullable enabled reference type, false if optional, null if value Type or #nullable not enabled

Parameters
TypeName
System.TypememberType
System.Reflection.MemberInfodeclaringType
System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData>customAttributes