Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hosting
  • Loading branch information
BrennanConroy committed May 1, 2022
commit 6f623a54a9644246cdb5cd28865386b2f55f25c3
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.Hosting;
#pragma warning disable CS0618 // Type or member is obsolete
internal class GenericWebHostApplicationLifetime : IApplicationLifetime
internal sealed class GenericWebHostApplicationLifetime : IApplicationLifetime
#pragma warning restore CS0618 // Type or member is obsolete
{
private readonly IHostApplicationLifetime _applicationLifetime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public IWebHostBuilder UseSetting(string key, string? value)
}

// This exists just so that we can use ActivatorUtilities.CreateInstance on the Startup class
private class HostServiceProvider : IServiceProvider
private sealed class HostServiceProvider : IServiceProvider
{
private readonly WebHostBuilderContext _context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class GenericWebHostServiceOptions
internal sealed class GenericWebHostServiceOptions
{
public Action<IApplicationBuilder>? ConfigureApplication { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Hosting/src/Internal/ApplicationLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Hosting;
/// Allows consumers to perform cleanup during a graceful shutdown.
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
internal class ApplicationLifetime : IApplicationLifetime, Extensions.Hosting.IApplicationLifetime, IHostApplicationLifetime
internal sealed class ApplicationLifetime : IApplicationLifetime, Extensions.Hosting.IApplicationLifetime, IHostApplicationLifetime
#pragma warning restore CS0618 // Type or member is obsolete
{
private readonly CancellationTokenSource _startedSource = new CancellationTokenSource();
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Hosting/src/Internal/ConfigureBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class ConfigureBuilder
internal sealed class ConfigureBuilder
{
public ConfigureBuilder(MethodInfo configure)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class ConfigureContainerBuilder
internal sealed class ConfigureContainerBuilder
{
public ConfigureContainerBuilder(MethodInfo? configureContainerMethod)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class ConfigureServicesBuilder
internal sealed class ConfigureServicesBuilder
{
public ConfigureServicesBuilder(MethodInfo? configureServices)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class HostedServiceExecutor
internal sealed class HostedServiceExecutor
{
private readonly IEnumerable<IHostedService> _services;
private readonly ILogger<HostedServiceExecutor> _logger;
Expand Down
4 changes: 2 additions & 2 deletions src/Hosting/Hosting/src/Internal/HostingApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class HostingApplication : IHttpApplication<HostingApplication.Context>
internal sealed class HostingApplication : IHttpApplication<HostingApplication.Context>
{
private readonly RequestDelegate _application;
private readonly IHttpContextFactory? _httpContextFactory;
Expand Down Expand Up @@ -116,7 +116,7 @@ public void DisposeContext(Context context, Exception? exception)
context.Reset();
}

internal class Context
internal sealed class Context
{
public HttpContext? HttpContext { get; set; }
public IDisposable? Scope { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class HostingApplicationDiagnostics
internal sealed class HostingApplicationDiagnostics
{
private static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency;

Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Hosting/src/Internal/HostingEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.Hosting;
#pragma warning disable CS0618 // Type or member is obsolete
internal class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment, IWebHostEnvironment
internal sealed class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment, IWebHostEnvironment
#pragma warning restore CS0618 // Type or member is obsolete
{
public string EnvironmentName { get; set; } = Extensions.Hosting.Environments.Production;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ internal static void Initialize(
}

hostingEnvironment.EnvironmentName =
baseEnvironment?.EnvironmentName ??
baseEnvironment?.EnvironmentName ??
options.Environment ??
hostingEnvironment.EnvironmentName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Hosting;

using static HostingRequestStartingLog;

internal class HostingRequestFinishedLog : IReadOnlyList<KeyValuePair<string, object?>>
internal sealed class HostingRequestFinishedLog : IReadOnlyList<KeyValuePair<string, object?>>
{
internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HostingRequestFinishedLog)state).ToString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class HostingRequestStartingLog : IReadOnlyList<KeyValuePair<string, object?>>
internal sealed class HostingRequestStartingLog : IReadOnlyList<KeyValuePair<string, object?>>
{
private const string LogPreamble = "Request starting ";
private const string EmptyEntry = "-";
Expand Down
4 changes: 2 additions & 2 deletions src/Hosting/Hosting/src/Internal/StartupLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class StartupLoader
internal sealed class StartupLoader
{
// Creates an <see cref="StartupMethods"/> instance with the actions to run for configuring the application services and the
// request pipeline of the application.
Expand Down Expand Up @@ -68,7 +68,7 @@ private abstract class ConfigureServicesDelegateBuilder
public abstract Func<IServiceCollection, IServiceProvider> Build();
}

private class ConfigureServicesDelegateBuilder<TContainerBuilder> : ConfigureServicesDelegateBuilder where TContainerBuilder : notnull
private sealed class ConfigureServicesDelegateBuilder<TContainerBuilder> : ConfigureServicesDelegateBuilder where TContainerBuilder : notnull
{
public ConfigureServicesDelegateBuilder(
IServiceProvider hostingServiceProvider,
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Hosting/src/Internal/StartupMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class StartupMethods
internal sealed class StartupMethods
{
public StartupMethods(object? instance, Action<IApplicationBuilder> configure, Func<IServiceCollection, IServiceProvider> configureServices)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Hosting/src/Internal/WebHostLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class WebHostLifetime : IDisposable
internal sealed class WebHostLifetime : IDisposable
{
private readonly CancellationTokenSource _cts;
private readonly ManualResetEventSlim _resetEvent;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Hosting/src/Internal/WebHostOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class WebHostOptions
internal sealed class WebHostOptions
{
public WebHostOptions(IConfiguration primaryConfiguration, IConfiguration? fallbackConfiguration = null, IHostEnvironment? environment = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Hosting/src/Internal/WebHostUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class WebHostUtilities
internal sealed class WebHostUtilities
{
public static bool ParseBool(string? value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Microsoft.AspNetCore.Hosting;

internal class ConventionBasedStartup : IStartup
internal sealed class ConventionBasedStartup : IStartup
{
private readonly StartupMethods _methods;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Net.Http;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNetCore.Server.IntegrationTesting;

internal class LoggingHandler : DelegatingHandler
internal sealed class LoggingHandler : DelegatingHandler
{
private readonly ILogger _logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private static Scripts CopyEmbeddedScriptFilesToDisk()
return scripts;
}

private class Scripts
private sealed class Scripts
{
public Scripts(string remotePSSessionHelper, string startServer, string stopServer)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.Server.IntegrationTesting;

internal class ProcessHelpers
internal sealed class ProcessHelpers
{
public static void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, IDictionary<string, string> environmentVariables, ILogger logger)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/ApplicationWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal abstract class ApplicationWrapper
internal abstract void DisposeContext(object context, Exception? exception);
}

internal class ApplicationWrapper<TContext> : ApplicationWrapper, IHttpApplication<TContext> where TContext : notnull
internal sealed class ApplicationWrapper<TContext> : ApplicationWrapper, IHttpApplication<TContext> where TContext : notnull
{
private readonly IHttpApplication<TContext> _application;
private readonly Action _preProcessRequestAsync;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/AsyncStreamWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class AsyncStreamWrapper : Stream
internal sealed class AsyncStreamWrapper : Stream
{
private readonly Stream _inner;
private readonly Func<bool> _allowSynchronousIO;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/HttpContextBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class HttpContextBuilder : IHttpBodyControlFeature, IHttpResetFeature
internal sealed class HttpContextBuilder : IHttpBodyControlFeature, IHttpResetFeature
{
private readonly ApplicationWrapper _application;
private readonly bool _preserveExecutionContext;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/NoopHostLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class NoopHostLifetime : IHostLifetime
internal sealed class NoopHostLifetime : IHostLifetime
{
public Task StopAsync(CancellationToken cancellationToken)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/RequestBodyDetectionFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class RequestBodyDetectionFeature : IHttpRequestBodyDetectionFeature
internal sealed class RequestBodyDetectionFeature : IHttpRequestBodyDetectionFeature
{
public RequestBodyDetectionFeature(bool canHaveBody)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/RequestFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class RequestFeature : IHttpRequestFeature
internal sealed class RequestFeature : IHttpRequestFeature
{
public RequestFeature()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/RequestLifetimeFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class RequestLifetimeFeature : IHttpRequestLifetimeFeature
internal sealed class RequestLifetimeFeature : IHttpRequestLifetimeFeature
{
private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
private readonly Action<Exception> _abort;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/ResponseBodyPipeWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class ResponseBodyPipeWriter : PipeWriter
internal sealed class ResponseBodyPipeWriter : PipeWriter
{
private readonly Func<Task> _onFirstWriteAsync;
private readonly Pipe _pipe;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/ResponseBodyReaderStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.TestHost;
/// <summary>
/// The client's view of the response body.
/// </summary>
internal class ResponseBodyReaderStream : Stream
internal sealed class ResponseBodyReaderStream : Stream
{
private bool _readerComplete;
private bool _aborted;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/ResponseBodyWriterStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class ResponseBodyWriterStream : Stream
internal sealed class ResponseBodyWriterStream : Stream
{
private readonly ResponseBodyPipeWriter _responseWriter;
private readonly Func<bool> _allowSynchronousIO;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/ResponseFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class ResponseFeature : IHttpResponseFeature, IHttpResponseBodyFeature
internal sealed class ResponseFeature : IHttpResponseFeature, IHttpResponseBodyFeature
{
private readonly HeaderDictionary _headers = new HeaderDictionary();
private readonly Action<Exception> _abort;
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/TestHost/src/ResponseTrailersFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.TestHost;

internal class ResponseTrailersFeature : IHttpResponseTrailersFeature
internal sealed class ResponseTrailersFeature : IHttpResponseTrailersFeature
{
public IHeaderDictionary Trailers { get; set; } = new HeaderDictionary();
}
Loading