PlatformExtensions
Assembly: ServiceStack.Text.dll
View Source
public static class PlatformExtensions
Methods
IsInterface(Type)
View Source
[Obsolete("Use type.IsInterface")]
public static bool IsInterface(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsArray(Type)
View Source
[Obsolete("Use type.IsArray")]
public static bool IsArray(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsValueType(Type)
View Source
[Obsolete("Use type.IsValueType")]
public static bool IsValueType(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsGeneric(Type)
View Source
[Obsolete("Use type.IsGenericType")]
public static bool IsGeneric(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
BaseType(Type)
View Source
[Obsolete("Use type.BaseType")]
public static Type BaseType(this Type type)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | type |
ReflectedType(PropertyInfo)
View Source
[Obsolete("Use pi.ReflectedType")]
public static Type ReflectedType(this PropertyInfo pi)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
ReflectedType(FieldInfo)
View Source
[Obsolete("Use fi.ReflectedType")]
public static Type ReflectedType(this FieldInfo fi)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Reflection.FieldInfo | fi |
GenericTypeDefinition(Type)
View Source
[Obsolete("Use type.GetGenericTypeDefinition()")]
public static Type GenericTypeDefinition(this Type type)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | type |
GetTypeInterfaces(Type)
View Source
[Obsolete("Use type.GetInterfaces()")]
public static Type[] GetTypeInterfaces(this Type type)
Returns
System.Type[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetTypeGenericArguments(Type)
View Source
[Obsolete("Use type.GetGenericArguments()")]
public static Type[] GetTypeGenericArguments(this Type type)
Returns
System.Type[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetEmptyConstructor(Type)
View Source
[Obsolete("Use type.GetConstructor(Type.EmptyTypes)")]
public static ConstructorInfo GetEmptyConstructor(this Type type)
Returns
System.Reflection.ConstructorInfo
Parameters
Type | Name |
---|---|
System.Type | type |
GetAllConstructors(Type)
View Source
[Obsolete("Use type.GetConstructors()")]
public static IEnumerable<ConstructorInfo> GetAllConstructors(this Type type)
Returns
System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo>
Parameters
Type | Name |
---|---|
System.Type | type |
GetAssembly(Type)
View Source
[Obsolete("Use type.Assembly")]
public static Assembly GetAssembly(this Type type)
Returns
System.Reflection.Assembly
Parameters
Type | Name |
---|---|
System.Type | type |
Fields(Type)
View Source
public static FieldInfo[] Fields(this Type type)
Returns
System.Reflection.FieldInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
Properties(Type)
View Source
public static PropertyInfo[] Properties(this Type type)
Returns
System.Reflection.PropertyInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetAllFields(Type)
View Source
public static FieldInfo[] GetAllFields(this Type type)
Returns
System.Reflection.FieldInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetPublicFields(Type)
View Source
public static FieldInfo[] GetPublicFields(this Type type)
Returns
System.Reflection.FieldInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetPublicMembers(Type)
View Source
public static MemberInfo[] GetPublicMembers(this Type type)
Returns
System.Reflection.MemberInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetAllPublicMembers(Type)
View Source
public static MemberInfo[] GetAllPublicMembers(this Type type)
Returns
System.Reflection.MemberInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetStaticMethod(Type, String)
View Source
public static MethodInfo GetStaticMethod(this Type type, string methodName)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | methodName |
GetInstanceMethod(Type, String)
View Source
public static MethodInfo GetInstanceMethod(this Type type, string methodName)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | methodName |
Method(Delegate)
View Source
[Obsolete("Use fn.Method")]
public static MethodInfo Method(this Delegate fn)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Delegate | fn |
HasAttribute<T>(Type)
View Source
public static bool HasAttribute<T>(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
Type Parameters
T
HasAttributeOf<T>(Type)
View Source
public static bool HasAttributeOf<T>(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
Type Parameters
T
HasAttribute<T>(PropertyInfo)
View Source
public static bool HasAttribute<T>(this PropertyInfo pi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
Type Parameters
T
HasAttributeOf<T>(PropertyInfo)
View Source
public static bool HasAttributeOf<T>(this PropertyInfo pi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
Type Parameters
T
HasAttribute<T>(FieldInfo)
View Source
public static bool HasAttribute<T>(this FieldInfo fi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.FieldInfo | fi |
Type Parameters
T
HasAttributeOf<T>(FieldInfo)
View Source
public static bool HasAttributeOf<T>(this FieldInfo fi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.FieldInfo | fi |
Type Parameters
T
HasAttribute<T>(MethodInfo)
View Source
public static bool HasAttribute<T>(this MethodInfo mi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | mi |
Type Parameters
T
HasAttributeOf<T>(MethodInfo)
View Source
public static bool HasAttributeOf<T>(this MethodInfo mi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | mi |
Type Parameters
T
HasAttributeCached<T>(MemberInfo)
View Source
public static bool HasAttributeCached<T>(this MemberInfo memberInfo)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | memberInfo |
Type Parameters
T
HasAttributeOfCached<T>(MemberInfo)
View Source
public static bool HasAttributeOfCached<T>(this MemberInfo memberInfo)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | memberInfo |
Type Parameters
T
HasAttributeNamed(Type, String)
View Source
public static bool HasAttributeNamed(this Type type, string name)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | name |
HasAttributeNamed(PropertyInfo, String)
View Source
public static bool HasAttributeNamed(this PropertyInfo pi, string name)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
System.String | name |
HasAttributeNamed(FieldInfo, String)
View Source
public static bool HasAttributeNamed(this FieldInfo fi, string name)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.FieldInfo | fi |
System.String | name |
HasAttributeNamed(MemberInfo, String)
View Source
public static bool HasAttributeNamed(this MemberInfo mi, string name)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | mi |
System.String | name |
IsDto(Type)
View Source
public static bool IsDto(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
PropertyGetMethod(PropertyInfo, Boolean)
View Source
[Obsolete("Use pi.GetGetMethod(nonPublic)")]
public static MethodInfo PropertyGetMethod(this PropertyInfo pi, bool nonPublic = false)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
System.Boolean | nonPublic |
Interfaces(Type)
View Source
[Obsolete("Use type.GetInterfaces()")]
public static Type[] Interfaces(this Type type)
Returns
System.Type[]
Parameters
Type | Name |
---|---|
System.Type | type |
AllProperties(Type)
View Source
public static PropertyInfo[] AllProperties(this Type type)
Returns
System.Reflection.PropertyInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
ClearRuntimeAttributes()
View Source
public static void ClearRuntimeAttributes()
AddAttributes(Type, Attribute[])
View Source
public static Type AddAttributes(this Type type, params Attribute[] attrs)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | type |
System.Attribute[] | attrs |
AddAttributes(PropertyInfo, Attribute[])
Add a Property attribute at runtime. <p>Not threadsafe, should only add attributes on Startup.</p>
View Source
public static PropertyInfo AddAttributes(this PropertyInfo propertyInfo, params Attribute[] attrs)
Returns
System.Reflection.PropertyInfo
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
System.Attribute[] | attrs |
ReplaceAttribute(PropertyInfo, Attribute)
Add a Property attribute at runtime. <p>Not threadsafe, should only add attributes on Startup.</p>
View Source
public static PropertyInfo ReplaceAttribute(this PropertyInfo propertyInfo, Attribute attr)
Returns
System.Reflection.PropertyInfo
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
System.Attribute | attr |
GetAttributes<TAttr>(PropertyInfo)
View Source
public static List<TAttr> GetAttributes<TAttr>(this PropertyInfo propertyInfo)
Returns
System.Collections.Generic.List<<TAttr>>
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
Type Parameters
TAttr
GetAttributes(PropertyInfo)
View Source
public static List<Attribute> GetAttributes(this PropertyInfo propertyInfo)
Returns
System.Collections.Generic.List<System.Attribute>
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
GetAttributes(PropertyInfo, Type)
View Source
public static List<Attribute> GetAttributes(this PropertyInfo propertyInfo, Type attrType)
Returns
System.Collections.Generic.List<System.Attribute>
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
System.Type | attrType |
AllAttributes(PropertyInfo)
View Source
public static object[] AllAttributes(this PropertyInfo propertyInfo)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
AllAttributesLazy(PropertyInfo)
View Source
public static IEnumerable<object> AllAttributesLazy(this PropertyInfo propertyInfo)
Returns
System.Collections.Generic.IEnumerable<System.Object>
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
AllAttributes(PropertyInfo, Type)
View Source
public static object[] AllAttributes(this PropertyInfo propertyInfo, Type attrType)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
System.Type | attrType |
AllAttributesLazy(PropertyInfo, Type)
View Source
public static IEnumerable<object> AllAttributesLazy(this PropertyInfo propertyInfo, Type attrType)
Returns
System.Collections.Generic.IEnumerable<System.Object>
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
System.Type | attrType |
AllAttributes(ParameterInfo)
View Source
public static object[] AllAttributes(this ParameterInfo paramInfo)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.ParameterInfo | paramInfo |
AllAttributes(FieldInfo)
View Source
public static object[] AllAttributes(this FieldInfo fieldInfo)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.FieldInfo | fieldInfo |
AllAttributes(MemberInfo)
View Source
public static object[] AllAttributes(this MemberInfo memberInfo)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | memberInfo |
AllAttributes(ParameterInfo, Type)
View Source
public static object[] AllAttributes(this ParameterInfo paramInfo, Type attrType)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.ParameterInfo | paramInfo |
System.Type | attrType |
AllAttributes(MemberInfo, Type)
View Source
public static object[] AllAttributes(this MemberInfo memberInfo, Type attrType)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | memberInfo |
System.Type | attrType |
AllAttributes(FieldInfo, Type)
View Source
public static object[] AllAttributes(this FieldInfo fieldInfo, Type attrType)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.FieldInfo | fieldInfo |
System.Type | attrType |
AllAttributes(Type)
View Source
public static object[] AllAttributes(this Type type)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Type | type |
AllAttributesLazy(Type)
View Source
public static IEnumerable<object> AllAttributesLazy(this Type type)
Returns
System.Collections.Generic.IEnumerable<System.Object>
Parameters
Type | Name |
---|---|
System.Type | type |
AllAttributes(Type, Type)
View Source
public static object[] AllAttributes(this Type type, Type attrType)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Type | type |
System.Type | attrType |
AllAttributes(Assembly)
View Source
public static object[] AllAttributes(this Assembly assembly)
Returns
System.Object[]
Parameters
Type | Name |
---|---|
System.Reflection.Assembly | assembly |
AllAttributes<TAttr>(ParameterInfo)
View Source
public static TAttr[] AllAttributes<TAttr>(this ParameterInfo pi)
Returns
<TAttr>[]
Parameters
Type | Name |
---|---|
System.Reflection.ParameterInfo | pi |
Type Parameters
TAttr
AllAttributes<TAttr>(MemberInfo)
View Source
public static TAttr[] AllAttributes<TAttr>(this MemberInfo mi)
Returns
<TAttr>[]
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | mi |
Type Parameters
TAttr
AllAttributes<TAttr>(FieldInfo)
View Source
public static TAttr[] AllAttributes<TAttr>(this FieldInfo fi)
Returns
<TAttr>[]
Parameters
Type | Name |
---|---|
System.Reflection.FieldInfo | fi |
Type Parameters
TAttr
AllAttributes<TAttr>(PropertyInfo)
View Source
public static TAttr[] AllAttributes<TAttr>(this PropertyInfo pi)
Returns
<TAttr>[]
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
Type Parameters
TAttr
AllAttributesLazy<TAttr>(PropertyInfo)
View Source
public static IEnumerable<TAttr> AllAttributesLazy<TAttr>(this PropertyInfo pi)
Returns
System.Collections.Generic.IEnumerable<<TAttr>>
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
Type Parameters
TAttr
AllAttributes<TAttr>(Type)
View Source
public static TAttr[] AllAttributes<TAttr>(this Type type)
Returns
<TAttr>[]
Parameters
Type | Name |
---|---|
System.Type | type |
Type Parameters
TAttr
AllAttributesLazy<TAttr>(Type)
View Source
public static IEnumerable<TAttr> AllAttributesLazy<TAttr>(this Type type)
Returns
System.Collections.Generic.IEnumerable<<TAttr>>
Parameters
Type | Name |
---|---|
System.Type | type |
Type Parameters
TAttr
FirstAttribute<TAttr>(Type)
View Source
public static TAttr FirstAttribute<TAttr>(this Type type)
where TAttr : class
Returns
<TAttr>
Parameters
Type | Name |
---|---|
System.Type | type |
Type Parameters
TAttr
FirstAttribute<TAttribute>(MemberInfo)
View Source
public static TAttribute FirstAttribute<TAttribute>(this MemberInfo memberInfo)
Returns
<TAttribute>
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | memberInfo |
Type Parameters
TAttribute
FirstAttribute<TAttribute>(ParameterInfo)
View Source
public static TAttribute FirstAttribute<TAttribute>(this ParameterInfo paramInfo)
Returns
<TAttribute>
Parameters
Type | Name |
---|---|
System.Reflection.ParameterInfo | paramInfo |
Type Parameters
TAttribute
FirstAttribute<TAttribute>(PropertyInfo)
View Source
public static TAttribute FirstAttribute<TAttribute>(this PropertyInfo propertyInfo)
Returns
<TAttribute>
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | propertyInfo |
Type Parameters
TAttribute
FirstGenericTypeDefinition(Type)
View Source
public static Type FirstGenericTypeDefinition(this Type type)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | type |
IsDynamic(Assembly)
View Source
public static bool IsDynamic(this Assembly assembly)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.Assembly | assembly |
GetStaticMethod(Type, String, Type[])
View Source
public static MethodInfo GetStaticMethod(this Type type, string methodName, Type[] types)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | methodName |
System.Type[] | types |
GetMethodInfo(Type, String, Type[])
View Source
public static MethodInfo GetMethodInfo(this Type type, string methodName, Type[] types = null)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | methodName |
System.Type[] | types |
InvokeMethod(Delegate, Object, Object[])
View Source
public static object InvokeMethod(this Delegate fn, object instance, object[] parameters = null)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Delegate | fn |
System.Object | instance |
System.Object[] | parameters |
GetPublicStaticField(Type, String)
View Source
public static FieldInfo GetPublicStaticField(this Type type, string fieldName)
Returns
System.Reflection.FieldInfo
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | fieldName |
MakeDelegate(MethodInfo, Type, Boolean)
View Source
public static Delegate MakeDelegate(this MethodInfo mi, Type delegateType, bool throwOnBindFailure = true)
Returns
System.Delegate
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | mi |
System.Type | delegateType |
System.Boolean | throwOnBindFailure |
GenericTypeArguments(Type)
View Source
[Obsolete("Use type.GetGenericArguments()")]
public static Type[] GenericTypeArguments(this Type type)
Returns
System.Type[]
Parameters
Type | Name |
---|---|
System.Type | type |
DeclaredConstructors(Type)
View Source
[Obsolete("Use type.GetConstructors()")]
public static ConstructorInfo[] DeclaredConstructors(this Type type)
Returns
System.Reflection.ConstructorInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
AssignableFrom(Type, Type)
View Source
[Obsolete("Use type.IsAssignableFrom(fromType)")]
public static bool AssignableFrom(this Type type, Type fromType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
System.Type | fromType |
IsStandardClass(Type)
View Source
public static bool IsStandardClass(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsAbstract(Type)
View Source
[Obsolete("Use type.IsAbstract")]
public static bool IsAbstract(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
GetPropertyInfo(Type, String)
View Source
[Obsolete("Use type.GetProperty(propertyName)")]
public static PropertyInfo GetPropertyInfo(this Type type, string propertyName)
Returns
System.Reflection.PropertyInfo
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | propertyName |
GetFieldInfo(Type, String)
View Source
[Obsolete("Use type.GetField(fieldName)")]
public static FieldInfo GetFieldInfo(this Type type, string fieldName)
Returns
System.Reflection.FieldInfo
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | fieldName |
GetWritableFields(Type)
View Source
public static FieldInfo[] GetWritableFields(this Type type)
Returns
System.Reflection.FieldInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
SetMethod(PropertyInfo, Boolean)
View Source
[Obsolete("Use pi.GetSetMethod(nonPublic)")]
public static MethodInfo SetMethod(this PropertyInfo pi, bool nonPublic = true)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
System.Boolean | nonPublic |
GetMethodInfo(PropertyInfo, Boolean)
View Source
[Obsolete("Use pi.GetGetMethod(nonPublic)")]
public static MethodInfo GetMethodInfo(this PropertyInfo pi, bool nonPublic = true)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
System.Boolean | nonPublic |
InstanceOfType(Type, Object)
View Source
[Obsolete("Use type.IsInstanceOfType(instance)")]
public static bool InstanceOfType(this Type type, object instance)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
System.Object | instance |
IsAssignableFromType(Type, Type)
View Source
[Obsolete("Use type.IsAssignableFrom(fromType)")]
public static bool IsAssignableFromType(this Type type, Type fromType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
System.Type | fromType |
IsClass(Type)
View Source
[Obsolete("Use type.IsClass")]
public static bool IsClass(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsEnum(Type)
View Source
[Obsolete("Use type.IsEnum")]
public static bool IsEnum(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsEnumFlags(Type)
View Source
public static bool IsEnumFlags(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsUnderlyingEnum(Type)
View Source
public static bool IsUnderlyingEnum(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
GetInstanceMethods(Type)
View Source
public static MethodInfo[] GetInstanceMethods(this Type type)
Returns
System.Reflection.MethodInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetMethodInfos(Type)
View Source
[Obsolete("Use type.GetMethods()")]
public static MethodInfo[] GetMethodInfos(this Type type)
Returns
System.Reflection.MethodInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
GetPropertyInfos(Type)
View Source
[Obsolete("Use type.GetProperties()")]
public static PropertyInfo[] GetPropertyInfos(this Type type)
Returns
System.Reflection.PropertyInfo[]
Parameters
Type | Name |
---|---|
System.Type | type |
IsGenericTypeDefinition(Type)
View Source
[Obsolete("Use type.IsGenericTypeDefinition")]
public static bool IsGenericTypeDefinition(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
IsGenericType(Type)
View Source
[Obsolete("Use type.IsGenericType")]
public static bool IsGenericType(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
ContainsGenericParameters(Type)
View Source
[Obsolete("Use type.ContainsGenericParameters")]
public static bool ContainsGenericParameters(this Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
GetDeclaringTypeName(Type)
View Source
public static string GetDeclaringTypeName(this Type type)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Type | type |
GetDeclaringTypeName(MemberInfo)
View Source
public static string GetDeclaringTypeName(this MemberInfo mi)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Reflection.MemberInfo | mi |
CreateDelegate(MethodInfo, Type)
View Source
public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType)
Returns
System.Delegate
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | methodInfo |
System.Type | delegateType |
CreateDelegate(MethodInfo, Type, Object)
View Source
public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType, object target)
Returns
System.Delegate
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | methodInfo |
System.Type | delegateType |
System.Object | target |
ElementType(Type)
View Source
[Obsolete("Use type.GetElementType()")]
public static Type ElementType(this Type type)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | type |
GetCollectionType(Type)
View Source
public static Type GetCollectionType(this Type type)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | type |
GetCachedGenericType(Type, Type[])
View Source
public static Type GetCachedGenericType(this Type type, params Type[] argTypes)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | type |
System.Type[] | argTypes |
ToObjectDictionary(Object)
View Source
public static Dictionary<string, object> ToObjectDictionary(this object obj)
Returns
System.Collections.Generic.Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.Object | obj |
ToObjectDictionary(Object, Func<String, Object, Object>)
View Source
public static Dictionary<string, object> ToObjectDictionary(this object obj, Func<string, object, object> mapper)
Returns
System.Collections.Generic.Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.Object | obj |
System.Func<System.String,System.Object,System.Object> | mapper |
GetKeyValuePairsTypeDef(Type)
View Source
public static Type GetKeyValuePairsTypeDef(this Type dictType)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | dictType |
GetKeyValuePairTypeDef(Type)
View Source
public static Type GetKeyValuePairTypeDef(this Type genericEnumType)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.Type | genericEnumType |
GetKeyValuePairsTypes(Type, out Type, out Type)
View Source
public static bool GetKeyValuePairsTypes(this Type dictType, out Type keyType, out Type valueType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | dictType |
System.Type | keyType |
System.Type | valueType |
GetKeyValuePairsTypes(Type, out Type, out Type, out Type)
View Source
public static bool GetKeyValuePairsTypes(this Type dictType, out Type keyType, out Type valueType, out Type kvpType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | dictType |
System.Type | keyType |
System.Type | valueType |
System.Type | kvpType |
GetKeyValuePairTypes(Type, out Type, out Type)
View Source
public static bool GetKeyValuePairTypes(this Type kvpType, out Type keyType, out Type valueType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | kvpType |
System.Type | keyType |
System.Type | valueType |
FromObjectDictionary(IEnumerable<KeyValuePair<String, Object>>, Type)
View Source
public static object FromObjectDictionary(this IEnumerable<KeyValuePair<string, object>> values, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>> | values |
System.Type | type |
ShallowClone(IEnumerable)
View Source
public static IEnumerable ShallowClone(this IEnumerable xs)
Returns
System.Collections.IEnumerable
Parameters
Type | Name |
---|---|
System.Collections.IEnumerable | xs |
ConvertToObject<T>(T)
View Source
public static object ConvertToObject<T>(T value)
Returns
System.Object
Parameters
Type | Name |
---|---|
<T> | value |
Type Parameters
T
ConvertFromObject<T>(Object)
View Source
public static T ConvertFromObject<T>(object value)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Object | value |
Type Parameters
T
PopulateInstance(IEnumerable<KeyValuePair<String, Object>>, Object)
View Source
public static void PopulateInstance(this IEnumerable<KeyValuePair<string, object>> values, object instance)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>> | values |
System.Object | instance |
PopulateInstance(IEnumerable<KeyValuePair<String, String>>, Object)
View Source
public static void PopulateInstance(this IEnumerable<KeyValuePair<string, string>> values, object instance)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.String>> | values |
System.Object | instance |
FromObjectDictionary<T>(IEnumerable<KeyValuePair<String, Object>>)
View Source
public static T FromObjectDictionary<T>(this IEnumerable<KeyValuePair<string, object>> values)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>> | values |
Type Parameters
T
ToSafePartialObjectDictionary<T>(T)
View Source
public static Dictionary<string, object> ToSafePartialObjectDictionary<T>(this T instance)
Returns
System.Collections.Generic.Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
<T> | instance |
Type Parameters
T
MergeIntoObjectDictionary(Object, Object[])
View Source
public static Dictionary<string, object> MergeIntoObjectDictionary(this object obj, params object[] sources)
Returns
System.Collections.Generic.Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.Object | obj |
System.Object[] | sources |
ToStringDictionary(IEnumerable<KeyValuePair<String, Object>>)
View Source
public static Dictionary<string, string> ToStringDictionary(this IEnumerable<KeyValuePair<string, object>> from)
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>> | from |
ToStringDictionary(IEnumerable<KeyValuePair<String, Object>>, IEqualityComparer<String>)
View Source
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
Type | Name |
---|---|
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
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
Type | Name |
---|---|
System.Reflection.PropertyInfo | property |
IsNotNullable(Type, MemberInfo, IEnumerable<CustomAttributeData>)
Check if #nullable enabled reference type is non nullable
View Source
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
Type | Name |
---|---|
System.Type | memberType |
System.Reflection.MemberInfo | declaringType |
System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> | customAttributes |