NetCoreAppHostExtensions
Assembly: ServiceStack.dll
View Source
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
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
Type | Name |
---|---|
IWebHostBuilder | builder |
Action<ServiceStack.ServiceStackHost> | beforeConfigure |
Action<ServiceStack.ServiceStackHost> | afterConfigure |
Action<ServiceStack.ServiceStackHost> | afterPluginsLoaded |
Action<ServiceStack.ServiceStackHost> | afterAppHostInit |
GetConfiguration(IAppHost)
View Source
public static IConfiguration GetConfiguration(this IAppHost appHost)
Returns
IConfiguration
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
GetApp(IAppHost)
View Source
public static IApplicationBuilder GetApp(this IAppHost appHost)
Returns
IApplicationBuilder
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
GetApplicationServices(IAppHost)
View Source
public static IServiceProvider GetApplicationServices(this IAppHost appHost)
Returns
IServiceProvider
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
GetHostingEnvironment(IAppHost)
View Source
public static Microsoft.AspNetCore.Hosting.IHostingEnvironment GetHostingEnvironment(this IAppHost appHost)
Returns
Microsoft.AspNetCore.Hosting.IHostingEnvironment
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
IsDevelopmentEnvironment(IAppHost)
View Source
public static bool IsDevelopmentEnvironment(this IAppHost appHost)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
IsStagingEnvironment(IAppHost)
View Source
public static bool IsStagingEnvironment(this IAppHost appHost)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
IsProductionEnvironment(IAppHost)
View Source
public static bool IsProductionEnvironment(this IAppHost appHost)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
UseServiceStack(IApplicationBuilder, AppHostBase)
View Source
public static IApplicationBuilder UseServiceStack(this IApplicationBuilder app, AppHostBase appHost)
Returns
IApplicationBuilder
Parameters
Type | Name |
---|---|
IApplicationBuilder | app |
ServiceStack.AppHostBase | appHost |
Use(IApplicationBuilder, IHttpAsyncHandler)
View Source
public static IApplicationBuilder Use(this IApplicationBuilder app, IHttpAsyncHandler httpHandler)
Returns
IApplicationBuilder
Parameters
Type | Name |
---|---|
IApplicationBuilder | app |
ServiceStack.Host.IHttpAsyncHandler | httpHandler |
ToRequest(HttpContext, String)
View Source
public static IHttpRequest ToRequest(this HttpContext httpContext, string operationName = null)
Returns
Parameters
Type | Name |
---|---|
HttpContext | httpContext |
System.String | operationName |
TryResolve<T>(IServiceProvider)
View Source
public static T TryResolve<T>(this IServiceProvider provider)
Returns
<T>
Parameters
Type | Name |
---|---|
IServiceProvider | provider |
Type Parameters
T
Resolve<T>(IServiceProvider)
View Source
public static T Resolve<T>(this IServiceProvider provider)
Returns
<T>
Parameters
Type | Name |
---|---|
IServiceProvider | provider |
Type Parameters
T
ToRequest(HttpRequest, String)
View Source
public static IHttpRequest ToRequest(this HttpRequest request, string operationName = null)
Returns
Parameters
Type | Name |
---|---|
HttpRequest | request |
System.String | operationName |
TryResolveScoped<T>(IRequest)
View Source
public static T TryResolveScoped<T>(this IRequest req)
Returns
<T>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
Type Parameters
T
TryResolveScoped(IRequest, Type)
View Source
public static object TryResolveScoped(this IRequest req, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
Type | type |
ResolveScoped<T>(IRequest)
View Source
public static T ResolveScoped<T>(this IRequest req)
Returns
<T>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
Type Parameters
T
ResolveScoped(IRequest, Type)
View Source
public static object ResolveScoped(this IRequest req, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
Type | type |
CreateScope(IRequest)
View Source
public static IServiceScope CreateScope(this IRequest req)
Returns
IServiceScope
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
GetServices(IRequest, Type)
View Source
public static IEnumerable<object> GetServices(this IRequest req, Type type)
Returns
IEnumerable<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
Type | type |
GetServices<T>(IRequest)
View Source
public static IEnumerable<T> GetServices<T>(this IRequest req)
Returns
IEnumerable<<T>>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
Type Parameters
T
GetOrCreateRequest(IHttpContextAccessor)
Creates an IRequest from IHttpContextAccessor if it's been registered as a singleton
View Source
public static IRequest GetOrCreateRequest(this IHttpContextAccessor httpContextAccessor)
Returns
Parameters
Type | Name |
---|---|
IHttpContextAccessor | httpContextAccessor |
GetOrCreateRequest(HttpContext)
View Source
public static IRequest GetOrCreateRequest(this HttpContext httpContext)
Returns
Parameters
Type | Name |
---|---|
HttpContext | httpContext |