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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
Type Parameters
T
AssertPlugin<T>(IAppHost)
View Source
Declaration
public static T AssertPlugin<T>(this IAppHost appHost)
where T : class, IPlugin
Returns
<T>
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
System.Exception | ex |
System.String | target |
System.String | method |
NotifyStartupException(IAppHost, Exception)
View Source
Declaration
public static bool NotifyStartupException(this IAppHost appHost, Exception ex)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
System.Exception | ex |
Localize(String, IRequest)
View Source
Declaration
public static string Localize(this string text, IRequest request = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | text |
ServiceStack.Web.IRequest | request |
LocalizeFmt(String, IRequest, Object[])
View Source
Declaration
public static string LocalizeFmt(this string text, IRequest request, params object[] args)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | text |
ServiceStack.Web.IRequest | request |
System.Object[] | args |
LocalizeFmt(String, Object[])
View Source
Declaration
public static string LocalizeFmt(this string text, params object[] args)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | text |
System.Object[] | args |
Start(IAppHost, IEnumerable<String>)
View Source
Declaration
public static IAppHost Start(this IAppHost appHost, IEnumerable<string> urlBases)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
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
Type | Name |
---|---|
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
Type | Name |
---|---|
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
Type | Name |
---|---|
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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
IsRunAsAppTask(IAppHost)
View Source
Declaration
public static bool IsRunAsAppTask(this IAppHost appHost)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |