From 8672b1b04a9abc44377a5eac2b89d2fdeb7f0004 Mon Sep 17 00:00:00 2001 From: Henk Mollema Date: Sat, 16 Jun 2018 12:18:48 +0200 Subject: [PATCH] Inherit web IHostingEnvironment and IApplicationEnvironment from the Generic Host one (#1461) --- .../IApplicationLifetime.cs | 25 +------------------ .../IHostingEnvironment.cs | 24 +----------------- .../Internal/ApplicationLifetime.cs | 2 +- .../Internal/HostingEnvironment.cs | 2 +- 4 files changed, 4 insertions(+), 49 deletions(-) diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs b/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs index f4613dd7d9..cba94f40fe 100644 --- a/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs +++ b/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs @@ -8,30 +8,7 @@ namespace Microsoft.AspNetCore.Hosting /// /// Allows consumers to perform cleanup during a graceful shutdown. /// - public interface IApplicationLifetime + public interface IApplicationLifetime : Extensions.Hosting.IApplicationLifetime { - /// - /// Triggered when the application host has fully started and is about to wait - /// for a graceful shutdown. - /// - CancellationToken ApplicationStarted { get; } - - /// - /// Triggered when the application host is performing a graceful shutdown. - /// Requests may still be in flight. Shutdown will block until this event completes. - /// - CancellationToken ApplicationStopping { get; } - - /// - /// 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. - /// - CancellationToken ApplicationStopped { get; } - - /// - /// Requests termination of the current application. - /// - void StopApplication(); } } diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs b/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs index 5feeb38eb7..8278ba9f85 100644 --- a/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs +++ b/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs @@ -8,20 +8,8 @@ namespace Microsoft.AspNetCore.Hosting /// /// Provides information about the web hosting environment an application is running in. /// - public interface IHostingEnvironment + public interface IHostingEnvironment : Extensions.Hosting.IHostingEnvironment { - /// - /// 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. - /// - string EnvironmentName { get; set; } - - /// - /// Gets or sets the name of the application. This property is automatically set by the host to the assembly containing - /// the application entry point. - /// - string ApplicationName { get; set; } - /// /// Gets or sets the absolute path to the directory that contains the web-servable application content files. /// @@ -31,15 +19,5 @@ namespace Microsoft.AspNetCore.Hosting /// Gets or sets an pointing at . /// IFileProvider WebRootFileProvider { get; set; } - - /// - /// Gets or sets the absolute path to the directory that contains the application content files. - /// - string ContentRootPath { get; set; } - - /// - /// Gets or sets an pointing at . - /// - IFileProvider ContentRootFileProvider { get; set; } } } diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs b/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs index 958f8b5dcc..47d16e9654 100644 --- a/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs +++ b/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal /// /// Allows consumers to perform cleanup during a graceful shutdown. /// - public class ApplicationLifetime : IApplicationLifetime, Extensions.Hosting.IApplicationLifetime + public class ApplicationLifetime : IApplicationLifetime { private readonly CancellationTokenSource _startedSource = new CancellationTokenSource(); private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource(); diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs b/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs index 1f8d1887d7..34924ab365 100644 --- a/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs +++ b/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.Hosting.Internal { - public class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment + public class HostingEnvironment : IHostingEnvironment { public string EnvironmentName { get; set; } = Hosting.EnvironmentName.Production;