TypeExtensions
Assembly: ServiceStack.Common.dll
View Source
Declaration
public static class TypeExtensions
Methods
GetReferencedTypes(Type)
View Source
Declaration
public static Type[] GetReferencedTypes(this Type type)
Returns
System.Type[]
Parameters
Type | Name |
---|---|
System.Type | type |
AddReferencedTypes(Type, HashSet<Type>)
View Source
Declaration
public static void AddReferencedTypes(Type type, HashSet<Type> refTypes)
Parameters
Type | Name |
---|---|
System.Type | type |
System.Collections.Generic.HashSet<System.Type> | refTypes |
GetActivatorToCache(ConstructorInfo)
View Source
Declaration
public static ObjectActivator GetActivatorToCache(ConstructorInfo ctor)
Returns
Parameters
Type | Name |
---|---|
System.Reflection.ConstructorInfo | ctor |
GetActivator(ConstructorInfo)
View Source
Declaration
public static ObjectActivator GetActivator(this ConstructorInfo ctor)
Returns
Parameters
Type | Name |
---|---|
System.Reflection.ConstructorInfo | ctor |
GetInvokerToCache(MethodInfo)
View Source
Declaration
public static MethodInvoker GetInvokerToCache(MethodInfo method)
Returns
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetStaticInvokerToCache(MethodInfo)
View Source
Declaration
public static StaticMethodInvoker GetStaticInvokerToCache(MethodInfo method)
Returns
ServiceStack.StaticMethodInvoker
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetActionInvokerToCache(MethodInfo)
View Source
Declaration
public static ActionInvoker GetActionInvokerToCache(MethodInfo method)
Returns
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetStaticActionInvokerToCache(MethodInfo)
View Source
Declaration
public static StaticActionInvoker GetStaticActionInvokerToCache(MethodInfo method)
Returns
ServiceStack.StaticActionInvoker
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetInvokerDelegate(MethodInfo)
Create the correct Invoker Delegate Type based on the type of Method
View Source
Declaration
public static Delegate GetInvokerDelegate(this MethodInfo method)
Returns
System.Delegate
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetInvoker(MethodInfo)
Create an Invoker for public instance methods
View Source
Declaration
public static MethodInvoker GetInvoker(this MethodInfo method)
Returns
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetStaticInvoker(MethodInfo)
Create an Invoker for public static methods
View Source
Declaration
public static StaticMethodInvoker GetStaticInvoker(this MethodInfo method)
Returns
ServiceStack.StaticMethodInvoker
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetActionInvoker(MethodInfo)
Create an Invoker for public instance void methods
View Source
Declaration
public static ActionInvoker GetActionInvoker(this MethodInfo method)
Returns
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
GetStaticActionInvoker(MethodInfo)
Create an Invoker for public static void methods
View Source
Declaration
public static StaticActionInvoker GetStaticActionInvoker(this MethodInfo method)
Returns
ServiceStack.StaticActionInvoker
Parameters
Type | Name |
---|---|
System.Reflection.MethodInfo | method |
ConvertFromObject<T>(Object)
View Source
Declaration
public static T ConvertFromObject<T>(object value)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Object | value |
Type Parameters
T
ConvertToObject<T>(T)
View Source
Declaration
public static object ConvertToObject<T>(T value)
Returns
System.Object
Parameters
Type | Name |
---|---|
<T> | value |
Type Parameters
T
GetPropertyAccessor(Type, PropertyInfo)
View Source
Declaration
public static Func<object, object> GetPropertyAccessor(this Type type, PropertyInfo forProperty)
Returns
System.Func<System.Object,System.Object>
Parameters
Type | Name |
---|---|
System.Type | type |
System.Reflection.PropertyInfo | forProperty |
CreatePropertyAccessorExpression(Type, PropertyInfo)
View Source
Declaration
public static LambdaExpression CreatePropertyAccessorExpression(Type type, PropertyInfo forProperty)
Returns
System.Linq.Expressions.LambdaExpression
Parameters
Type | Name |
---|---|
System.Type | type |
System.Reflection.PropertyInfo | forProperty |