Skip to main content

AppHostExtensions

Assembly: ServiceStack.dll
View Source
Declaration
public static class AppHostExtensions

Methods

ConfigureOperation<T>(IAppHost, Action<Operation>)

View Source
Declaration
public static void ConfigureOperation<T>(this IAppHost appHost, Action<Operation> configure)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Action<ServiceStack.Host.Operation>configure
Type Parameters
  • T

ConfigureOperations(IAppHost, Action<Operation>)

View Source
Declaration
public static void ConfigureOperations(this IAppHost appHost, Action<Operation> configure)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Action<ServiceStack.Host.Operation>configure

ConfigureType<T>(IAppHost, Action<MetadataType>)

View Source
Declaration
public static void ConfigureType<T>(this IAppHost appHost, Action<MetadataType> configure)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Action<ServiceStack.MetadataType>configure
Type Parameters
  • T

ConfigureTypes(IAppHost, Action<MetadataType>)

View Source
Declaration
public static void ConfigureTypes(this IAppHost appHost, Action<MetadataType> configure)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Action<ServiceStack.MetadataType>configure

ConfigureTypes(IAppHost, Action<MetadataType>, Predicate<MetadataType>)

View Source
Declaration
public static void ConfigureTypes(this IAppHost appHost, Action<MetadataType> configure, Predicate<MetadataType> where)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Action<ServiceStack.MetadataType>configure
System.Predicate<ServiceStack.MetadataType>where

RegisterServices(IAppHost, Dictionary<Type, String[]>)

View Source
Declaration
public static void RegisterServices(this IAppHost appHost, Dictionary<Type, string[]> serviceRoutes)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Collections.Generic.Dictionary<System.Type,System.String[]>serviceRoutes

RemoveService<T>(Dictionary<Type, String[]>)

View Source
Declaration
public static Dictionary<Type, string[]> RemoveService<T>(this Dictionary<Type, string[]> serviceRoutes)
Returns

System.Collections.Generic.Dictionary<System.Type,System.String[]>

Parameters
TypeName
System.Collections.Generic.Dictionary<System.Type,System.String[]>serviceRoutes
Type Parameters
  • T

RegisterService<TService>(IAppHost, String[])

View Source
Declaration
public static void RegisterService<TService>(this IAppHost appHost, params string[] atRestPaths)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.String[]atRestPaths
Type Parameters
  • TService

RegisterRequestBinder<TRequest>(IAppHost, Func<IRequest, Object>)

View Source
Declaration
public static void RegisterRequestBinder<TRequest>(this IAppHost appHost, Func<IRequest, object> binder)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Func<ServiceStack.Web.IRequest,System.Object>binder
Type Parameters
  • TRequest

AddPluginsFromAssembly(IAppHost, Assembly[])

View Source
Declaration
public static void AddPluginsFromAssembly(this IAppHost appHost, params Assembly[] assembliesWithPlugins)
Parameters
TypeName
ServiceStack.IAppHostappHost
System.Reflection.Assembly[]assembliesWithPlugins

GetPlugin<T>(IAppHost)

View Source
Declaration
public static T GetPlugin<T>(this IAppHost appHost)
where T : class, IPlugin
Returns

<T>

Parameters
TypeName
ServiceStack.IAppHostappHost
Type Parameters
  • T

AssertPlugin<T>(IAppHost)

View Source
Declaration
public static T AssertPlugin<T>(this IAppHost appHost)
where T : class, IPlugin
Returns

<T>

Parameters
TypeName
ServiceStack.IAppHostappHost
Type Parameters
  • T

HasPlugin<T>(IAppHost)

View Source
Declaration
public static bool HasPlugin<T>(this IAppHost appHost)
where T : class, IPlugin
Returns

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost
Type Parameters
  • T

HasMultiplePlugins<T>(IAppHost)

View Source
Declaration
public static bool HasMultiplePlugins<T>(this IAppHost appHost)
where T : class, IPlugin
Returns

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost
Type Parameters
  • T

GetContainer(IAppHost)

Get an IAppHost container. Note: Registering dependencies should only be done during setup/configuration stage and remain immutable there after for thread-safety.

View Source
Declaration
public static Container GetContainer(this IAppHost appHost)
Returns

Funq.Container

Parameters
TypeName
ServiceStack.IAppHostappHost

NotifyStartupException(IAppHost, Exception, String, String)

View Source
Declaration
public static bool NotifyStartupException(this IAppHost appHost, Exception ex, string target, string method)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost
System.Exceptionex
System.Stringtarget
System.Stringmethod

NotifyStartupException(IAppHost, Exception)

View Source
Declaration
public static bool NotifyStartupException(this IAppHost appHost, Exception ex)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost
System.Exceptionex

Localize(String, IRequest)

View Source
Declaration
public static string Localize(this string text, IRequest request = null)
Returns

System.String

Parameters
TypeName
System.Stringtext
ServiceStack.Web.IRequestrequest

LocalizeFmt(String, IRequest, Object[])

View Source
Declaration
public static string LocalizeFmt(this string text, IRequest request, params object[] args)
Returns

System.String

Parameters
TypeName
System.Stringtext
ServiceStack.Web.IRequestrequest
System.Object[]args

LocalizeFmt(String, Object[])

View Source
Declaration
public static string LocalizeFmt(this string text, params object[] args)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Object[]args

Start(IAppHost, IEnumerable<String>)

View Source
Declaration
public static IAppHost Start(this IAppHost appHost, IEnumerable<string> urlBases)
Returns

ServiceStack.IAppHost

Parameters
TypeName
ServiceStack.IAppHostappHost
System.Collections.Generic.IEnumerable<System.String>urlBases

AddIfDebug<T>(List<IPlugin>, T)

View Source
Declaration
public static List<IPlugin> AddIfDebug<T>(this List<IPlugin> plugins, T plugin)
where T : class, IPlugin
Returns

System.Collections.Generic.List<ServiceStack.IPlugin>

Parameters
TypeName
System.Collections.Generic.List<ServiceStack.IPlugin>plugins
<T>plugin
Type Parameters
  • T

AddIfNotExists<T>(List<IPlugin>, T)

View Source
Declaration
public static List<IPlugin> AddIfNotExists<T>(this List<IPlugin> plugins, T plugin)
where T : class, IPlugin
Returns

System.Collections.Generic.List<ServiceStack.IPlugin>

Parameters
TypeName
System.Collections.Generic.List<ServiceStack.IPlugin>plugins
<T>plugin
Type Parameters
  • T

AddIfNotExists<T>(List<IPlugin>, T, Action<T>)

View Source
Declaration
public static List<IPlugin> AddIfNotExists<T>(this List<IPlugin> plugins, T plugin, Action<T> configure)
where T : class, IPlugin
Returns

System.Collections.Generic.List<ServiceStack.IPlugin>

Parameters
TypeName
System.Collections.Generic.List<ServiceStack.IPlugin>plugins
<T>plugin
System.Action<<T>>configure
Type Parameters
  • T

ResolveStaticBaseUrl(IAppHost)

View Source
Declaration
public static string ResolveStaticBaseUrl(this IAppHost appHost)
Returns

System.String

Parameters
TypeName
ServiceStack.IAppHostappHost

IsRunAsAppTask(IAppHost)

View Source
Declaration
public static bool IsRunAsAppTask(this IAppHost appHost)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost