Skip to main content

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
TypeName
System.Typetype

AddReferencedTypes(Type, HashSet<Type>)

View Source
Declaration
public static void AddReferencedTypes(Type type, HashSet<Type> refTypes)
Parameters
TypeName
System.Typetype
System.Collections.Generic.HashSet<System.Type>refTypes

GetActivatorToCache(ConstructorInfo)

View Source
Declaration
public static ObjectActivator GetActivatorToCache(ConstructorInfo ctor)
Returns

ServiceStack.ObjectActivator

Parameters
TypeName
System.Reflection.ConstructorInfoctor

GetActivator(ConstructorInfo)

View Source
Declaration
public static ObjectActivator GetActivator(this ConstructorInfo ctor)
Returns

ServiceStack.ObjectActivator

Parameters
TypeName
System.Reflection.ConstructorInfoctor

GetInvokerToCache(MethodInfo)

View Source
Declaration
public static MethodInvoker GetInvokerToCache(MethodInfo method)
Returns

ServiceStack.MethodInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

GetStaticInvokerToCache(MethodInfo)

View Source
Declaration
public static StaticMethodInvoker GetStaticInvokerToCache(MethodInfo method)
Returns

ServiceStack.StaticMethodInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

GetActionInvokerToCache(MethodInfo)

View Source
Declaration
public static ActionInvoker GetActionInvokerToCache(MethodInfo method)
Returns

ServiceStack.ActionInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

GetStaticActionInvokerToCache(MethodInfo)

View Source
Declaration
public static StaticActionInvoker GetStaticActionInvokerToCache(MethodInfo method)
Returns

ServiceStack.StaticActionInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

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
TypeName
System.Reflection.MethodInfomethod

GetInvoker(MethodInfo)

Create an Invoker for public instance methods

View Source
Declaration
public static MethodInvoker GetInvoker(this MethodInfo method)
Returns

ServiceStack.MethodInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

GetStaticInvoker(MethodInfo)

Create an Invoker for public static methods

View Source
Declaration
public static StaticMethodInvoker GetStaticInvoker(this MethodInfo method)
Returns

ServiceStack.StaticMethodInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

GetActionInvoker(MethodInfo)

Create an Invoker for public instance void methods

View Source
Declaration
public static ActionInvoker GetActionInvoker(this MethodInfo method)
Returns

ServiceStack.ActionInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

GetStaticActionInvoker(MethodInfo)

Create an Invoker for public static void methods

View Source
Declaration
public static StaticActionInvoker GetStaticActionInvoker(this MethodInfo method)
Returns

ServiceStack.StaticActionInvoker

Parameters
TypeName
System.Reflection.MethodInfomethod

ConvertFromObject<T>(Object)

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

<T>

Parameters
TypeName
System.Objectvalue
Type Parameters
  • T

ConvertToObject<T>(T)

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

System.Object

Parameters
TypeName
<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
TypeName
System.Typetype
System.Reflection.PropertyInfoforProperty

CreatePropertyAccessorExpression(Type, PropertyInfo)

View Source
Declaration
public static LambdaExpression CreatePropertyAccessorExpression(Type type, PropertyInfo forProperty)
Returns

System.Linq.Expressions.LambdaExpression

Parameters
TypeName
System.Typetype
System.Reflection.PropertyInfoforProperty