Inherit web IHostingEnvironment and IApplicationEnvironment from the Generic Host one (#1461)
This commit is contained in:
parent
c5de0e1892
commit
8672b1b04a
|
|
@ -8,30 +8,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows consumers to perform cleanup during a graceful shutdown.
|
/// Allows consumers to perform cleanup during a graceful shutdown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IApplicationLifetime
|
public interface IApplicationLifetime : Extensions.Hosting.IApplicationLifetime
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Triggered when the application host has fully started and is about to wait
|
|
||||||
/// for a graceful shutdown.
|
|
||||||
/// </summary>
|
|
||||||
CancellationToken ApplicationStarted { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Triggered when the application host is performing a graceful shutdown.
|
|
||||||
/// Requests may still be in flight. Shutdown will block until this event completes.
|
|
||||||
/// </summary>
|
|
||||||
CancellationToken ApplicationStopping { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Triggered when the application host is performing a graceful shutdown.
|
|
||||||
/// All requests should be complete at this point. Shutdown will block
|
|
||||||
/// until this event completes.
|
|
||||||
/// </summary>
|
|
||||||
CancellationToken ApplicationStopped { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Requests termination of the current application.
|
|
||||||
/// </summary>
|
|
||||||
void StopApplication();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,20 +8,8 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides information about the web hosting environment an application is running in.
|
/// Provides information about the web hosting environment an application is running in.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IHostingEnvironment
|
public interface IHostingEnvironment : Extensions.Hosting.IHostingEnvironment
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the name of the environment. The host automatically sets this property to the value
|
|
||||||
/// of the "ASPNETCORE_ENVIRONMENT" environment variable, or "environment" as specified in any other configuration source.
|
|
||||||
/// </summary>
|
|
||||||
string EnvironmentName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the name of the application. This property is automatically set by the host to the assembly containing
|
|
||||||
/// the application entry point.
|
|
||||||
/// </summary>
|
|
||||||
string ApplicationName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the absolute path to the directory that contains the web-servable application content files.
|
/// Gets or sets the absolute path to the directory that contains the web-servable application content files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -31,15 +19,5 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
/// Gets or sets an <see cref="IFileProvider"/> pointing at <see cref="WebRootPath"/>.
|
/// Gets or sets an <see cref="IFileProvider"/> pointing at <see cref="WebRootPath"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IFileProvider WebRootFileProvider { get; set; }
|
IFileProvider WebRootFileProvider { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the absolute path to the directory that contains the application content files.
|
|
||||||
/// </summary>
|
|
||||||
string ContentRootPath { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets an <see cref="IFileProvider"/> pointing at <see cref="ContentRootPath"/>.
|
|
||||||
/// </summary>
|
|
||||||
IFileProvider ContentRootFileProvider { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows consumers to perform cleanup during a graceful shutdown.
|
/// Allows consumers to perform cleanup during a graceful shutdown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ApplicationLifetime : IApplicationLifetime, Extensions.Hosting.IApplicationLifetime
|
public class ApplicationLifetime : IApplicationLifetime
|
||||||
{
|
{
|
||||||
private readonly CancellationTokenSource _startedSource = new CancellationTokenSource();
|
private readonly CancellationTokenSource _startedSource = new CancellationTokenSource();
|
||||||
private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource();
|
private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource();
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using Microsoft.Extensions.FileProviders;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Hosting.Internal
|
namespace Microsoft.AspNetCore.Hosting.Internal
|
||||||
{
|
{
|
||||||
public class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment
|
public class HostingEnvironment : IHostingEnvironment
|
||||||
{
|
{
|
||||||
public string EnvironmentName { get; set; } = Hosting.EnvironmentName.Production;
|
public string EnvironmentName { get; set; } = Hosting.EnvironmentName.Production;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue