Skip to main content

NetCoreAppHostExtensions

Assembly: ServiceStack.dll
View Source
Declaration
public static class NetCoreAppHostExtensions : object

Methods

ConfigureAppHost(IWebHostBuilder, Action<ServiceStackHost>, Action<ServiceStackHost>, Action<ServiceStackHost>, Action<ServiceStackHost>)

Register static callbacks fired just after AppHost.Configure() <param name="builder" /> <param name="beforeConfigure">Register static callbacks fired just before AppHost.Configure()</param> <param name="afterConfigure">Register static callbacks fired just after AppHost.Configure()</param> <param name="afterPluginsLoaded">Register static callbacks fired just after plugins are loaded</param> <param name="afterAppHostInit">Register static callbacks fired after the AppHost is initialized</param>

View Source
Declaration
public static IWebHostBuilder ConfigureAppHost(this IWebHostBuilder builder, Action<ServiceStackHost> beforeConfigure = null, Action<ServiceStackHost> afterConfigure = null, Action<ServiceStackHost> afterPluginsLoaded = null, Action<ServiceStackHost> afterAppHostInit = null)
Returns

IWebHostBuilder

Parameters
TypeName
IWebHostBuilderbuilder
Action<ServiceStack.ServiceStackHost>beforeConfigure
Action<ServiceStack.ServiceStackHost>afterConfigure
Action<ServiceStack.ServiceStackHost>afterPluginsLoaded
Action<ServiceStack.ServiceStackHost>afterAppHostInit

GetConfiguration(IAppHost)

View Source
Declaration
public static IConfiguration GetConfiguration(this IAppHost appHost)
Returns

IConfiguration

Parameters
TypeName
ServiceStack.IAppHostappHost

GetApp(IAppHost)

View Source
Declaration
public static IApplicationBuilder GetApp(this IAppHost appHost)
Returns

IApplicationBuilder

Parameters
TypeName
ServiceStack.IAppHostappHost

GetApplicationServices(IAppHost)

View Source
Declaration
public static IServiceProvider GetApplicationServices(this IAppHost appHost)
Returns

IServiceProvider

Parameters
TypeName
ServiceStack.IAppHostappHost

GetHostingEnvironment(IAppHost)

View Source
Declaration
public static Microsoft.AspNetCore.Hosting.IHostingEnvironment GetHostingEnvironment(this IAppHost appHost)
Returns

Microsoft.AspNetCore.Hosting.IHostingEnvironment

Parameters
TypeName
ServiceStack.IAppHostappHost

IsDevelopmentEnvironment(IAppHost)

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

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost

IsStagingEnvironment(IAppHost)

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

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost

IsProductionEnvironment(IAppHost)

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

System.Boolean

Parameters
TypeName
ServiceStack.IAppHostappHost

UseServiceStack(IApplicationBuilder, AppHostBase)

View Source
Declaration
public static IApplicationBuilder UseServiceStack(this IApplicationBuilder app, AppHostBase appHost)
Returns

IApplicationBuilder

Parameters
TypeName
IApplicationBuilderapp
ServiceStack.AppHostBaseappHost

Use(IApplicationBuilder, IHttpAsyncHandler)

View Source
Declaration
public static IApplicationBuilder Use(this IApplicationBuilder app, IHttpAsyncHandler httpHandler)
Returns

IApplicationBuilder

Parameters
TypeName
IApplicationBuilderapp
ServiceStack.Host.IHttpAsyncHandlerhttpHandler

ToRequest(HttpContext, String)

View Source
Declaration
public static IHttpRequest ToRequest(this HttpContext httpContext, string operationName = null)
Returns

ServiceStack.Web.IHttpRequest

Parameters
TypeName
HttpContexthttpContext
System.StringoperationName

TryResolve<T>(IServiceProvider)

View Source
Declaration
public static T TryResolve<T>(this IServiceProvider provider)
Returns

<T>

Parameters
TypeName
IServiceProviderprovider
Type Parameters
  • T

Resolve<T>(IServiceProvider)

View Source
Declaration
public static T Resolve<T>(this IServiceProvider provider)
Returns

<T>

Parameters
TypeName
IServiceProviderprovider
Type Parameters
  • T

ToRequest(HttpRequest, String)

View Source
Declaration
public static IHttpRequest ToRequest(this HttpRequest request, string operationName = null)
Returns

ServiceStack.Web.IHttpRequest

Parameters
TypeName
HttpRequestrequest
System.StringoperationName

TryResolveScoped<T>(IRequest)

View Source
Declaration
public static T TryResolveScoped<T>(this IRequest req)
Returns

<T>

Parameters
TypeName
ServiceStack.Web.IRequestreq
Type Parameters
  • T

TryResolveScoped(IRequest, Type)

View Source
Declaration
public static object TryResolveScoped(this IRequest req, Type type)
Returns

System.Object

Parameters
TypeName
ServiceStack.Web.IRequestreq
Typetype

ResolveScoped<T>(IRequest)

View Source
Declaration
public static T ResolveScoped<T>(this IRequest req)
Returns

<T>

Parameters
TypeName
ServiceStack.Web.IRequestreq
Type Parameters
  • T

ResolveScoped(IRequest, Type)

View Source
Declaration
public static object ResolveScoped(this IRequest req, Type type)
Returns

System.Object

Parameters
TypeName
ServiceStack.Web.IRequestreq
Typetype

CreateScope(IRequest)

View Source
Declaration
public static IServiceScope CreateScope(this IRequest req)
Returns

IServiceScope

Parameters
TypeName
ServiceStack.Web.IRequestreq

GetServices(IRequest, Type)

View Source
Declaration
public static IEnumerable<object> GetServices(this IRequest req, Type type)
Returns

IEnumerable<System.Object>

Parameters
TypeName
ServiceStack.Web.IRequestreq
Typetype

GetServices<T>(IRequest)

View Source
Declaration
public static IEnumerable<T> GetServices<T>(this IRequest req)
Returns

IEnumerable<<T>>

Parameters
TypeName
ServiceStack.Web.IRequestreq
Type Parameters
  • T

GetOrCreateRequest(IHttpContextAccessor)

Creates an IRequest from IHttpContextAccessor if it's been registered as a singleton

View Source
Declaration
public static IRequest GetOrCreateRequest(this IHttpContextAccessor httpContextAccessor)
Returns

ServiceStack.Web.IRequest

Parameters
TypeName
IHttpContextAccessorhttpContextAccessor

GetOrCreateRequest(HttpContext)

View Source
Declaration
public static IRequest GetOrCreateRequest(this HttpContext httpContext)
Returns

ServiceStack.Web.IRequest

Parameters
TypeName
HttpContexthttpContext