Class StartupBase
Base class for the ASP.NET startup.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Application.AspNetCore
Assembly: Kephas.Application.AspNetCore.dll
Syntax
public abstract class StartupBase : AppBase
Remarks
Check https://docs.microsoft.com/en-us/aspnet/core/fundamentals/startup?view=aspnetcore-2.1 for more options.
Constructors
| Improve this Doc View SourceStartupBase(IHostingEnvironment, IConfiguration, IAmbientServices, String[])
Initializes a new instance of the StartupBase class.
Declaration
protected StartupBase(IHostingEnvironment env, IConfiguration config, IAmbientServices ambientServices = null, string[] appArgs = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Hosting.IHostingEnvironment | env | The environment. |
Microsoft.Extensions.Configuration.IConfiguration | config | The configuration. |
IAmbientServices | ambientServices | Optional. The ambient services. |
System.String[] | appArgs | Optional. The application arguments. |
Properties
| Improve this Doc View SourceConfiguration
Gets the configuration.
Declaration
public IConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
Microsoft.Extensions.Configuration.IConfiguration | The configuration. |
HostingEnvironment
Gets the hosting environment.
Declaration
public IHostingEnvironment HostingEnvironment { get; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Hosting.IHostingEnvironment | The hosting environment. |
Methods
| Improve this Doc View SourceConfigure(IApplicationBuilder, IApplicationLifetime)
Configures the given application.
Declaration
public virtual void Configure(IApplicationBuilder app, IApplicationLifetime appLifetime)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Builder.IApplicationBuilder | app | The application builder. |
Microsoft.AspNetCore.Hosting.IApplicationLifetime | appLifetime | The application lifetime. |
ConfigureServices(IServiceCollection)
Configures the DI services.
Declaration
public virtual IServiceProvider ConfigureServices(IServiceCollection serviceCollection)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | serviceCollection | Collection of services. |
Returns
Type | Description |
---|---|
System.IServiceProvider | An IServiceProvider. |
CreateAppContext(IAmbientServices)
Creates the application context.
Declaration
protected override IAppContext CreateAppContext(IAmbientServices ambientServices)
Parameters
Type | Name | Description |
---|---|---|
IAmbientServices | ambientServices | The ambient services. |
Returns
Type | Description |
---|---|
IAppContext | The new application context. |
Overrides
| Improve this Doc View SourceShutdownAsync(CancellationToken)
Shuts down the application asynchronously and gracefully.
Declaration
public override Task<IAppContext> ShutdownAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IAppContext> | A promise of the IAppContext. |