Skip to content

Commit 66584a0

Browse files
captainsafiaTratcherpranavkmJamesNK
authored
Add doc strings for public APIs in src/Hosting (#26443)
* Add doc strings for public APIs in src/Hosting * Apply suggestions from code review Co-authored-by: Chris Ross <Tratcher@Outlook.com> Co-authored-by: Pranav K <prkrishn@hotmail.com> Co-authored-by: James Newton-King <james@newtonking.com> * Address feedback from peer review Co-authored-by: Chris Ross <Tratcher@Outlook.com> Co-authored-by: Pranav K <prkrishn@hotmail.com> Co-authored-by: James Newton-King <james@newtonking.com>
1 parent b740b6a commit 66584a0

29 files changed

+318
-8
lines changed

src/Hosting/Abstractions/src/EnvironmentName.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@ namespace Microsoft.AspNetCore.Hosting
99
[System.Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments.", error: false)]
1010
public static class EnvironmentName
1111
{
12+
/// <summary>
13+
/// A string constant for Development environments.
14+
/// </summary>
1215
public static readonly string Development = "Development";
16+
17+
/// <summary>
18+
/// A string constant for Staging environments.
19+
/// </summary>
1320
public static readonly string Staging = "Staging";
21+
22+
/// <summary>
23+
/// A string constant for Production environments.
24+
/// </summary>
1425
public static readonly string Production = "Production";
1526
}
1627
}

src/Hosting/Abstractions/src/HostingAbstractionsWebHostBuilderExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
namespace Microsoft.AspNetCore.Hosting
1414
{
15+
/// <summary>
16+
/// Contains extension methods for configuring the <see cref="IWebHostBuilder" />.
17+
/// </summary>
1518
public static class HostingAbstractionsWebHostBuilderExtensions
1619
{
1720
/// <summary>

src/Hosting/Abstractions/src/IStartup.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,21 @@
77

88
namespace Microsoft.AspNetCore.Hosting
99
{
10+
/// <summary>
11+
/// Provides an interface for initializing services and middleware used by an application.
12+
/// </summary>
1013
public interface IStartup
1114
{
15+
/// <summary>
16+
/// Register services into the <see cref="IServiceCollection" />.
17+
/// </summary>
18+
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param>
1219
IServiceProvider ConfigureServices(IServiceCollection services);
1320

21+
/// <summary>
22+
/// Configures the application.
23+
/// </summary>
24+
/// <param name="app">An <see cref="IApplicationBuilder"/> for the app to configure.</param>
1425
void Configure(IApplicationBuilder app);
1526
}
16-
}
27+
}

src/Hosting/Abstractions/src/IStartupConfigureContainerFilter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ namespace Microsoft.AspNetCore.Hosting
1212
[Obsolete]
1313
public interface IStartupConfigureContainerFilter<TContainerBuilder>
1414
{
15+
/// <summary>
16+
/// Extends the provided <paramref name="container"/> and returns a modified <see cref="Action"/> action of the same type.
17+
/// </summary>
18+
/// <param name="container">The ConfigureContainer method to extend.</param>
19+
/// <returns>A modified <see cref="Action"/>.</returns>
1520
Action<TContainerBuilder> ConfigureContainer(Action<TContainerBuilder> container);
1621
}
1722
}

src/Hosting/Abstractions/src/IStartupConfigureServicesFilter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ namespace Microsoft.AspNetCore.Hosting
1313
[Obsolete]
1414
public interface IStartupConfigureServicesFilter
1515
{
16+
/// <summary>
17+
/// Extends the provided <paramref name="next"/> and returns a modified <see cref="Action"/> action of the same type.
18+
/// </summary>
19+
/// <param name="next">The ConfigureServices method to extend.</param>
20+
/// <returns>A modified <see cref="Action"/>.</returns>
1621
Action<IServiceCollection> ConfigureServices(Action<IServiceCollection> next);
1722
}
1823
}

src/Hosting/Abstractions/src/IStartupFilter.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@
66

77
namespace Microsoft.AspNetCore.Hosting
88
{
9+
/// <summary>
10+
/// Provides an interface for extending the middleware pipeline with new
11+
/// Configure methods. Can be used to add defaults to the beginning or
12+
/// end of the pipeline without having to make the app author explicitly
13+
/// register middleware.
14+
/// </summary>
915
public interface IStartupFilter
1016
{
17+
/// <summary>
18+
/// Extends the provided <paramref name="next"/> and returns an <see cref="Action"/> of the same type.
19+
/// </summary>
20+
/// <param name="next">The Configure method to extend.</param>
21+
/// <returns>A modified <see cref="Action"/>.</returns>
1122
Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next);
1223
}
1324
}

src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>ASP.NET Core hosting and startup abstractions for web applications.</Description>
55
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
66
<IsAspNetCoreApp>true</IsAspNetCoreApp>
7-
<NoWarn>$(NoWarn);CS1591</NoWarn>
7+
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<PackageTags>aspnetcore;hosting</PackageTags>
1010
<IsPackable>false</IsPackable>

src/Hosting/Abstractions/src/WebHostDefaults.cs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,85 @@
33

44
namespace Microsoft.AspNetCore.Hosting
55
{
6+
/// <summary>
7+
/// Contains a set of constants representing configuration keys.
8+
/// </summary>
69
public static class WebHostDefaults
710
{
11+
/// <summary>
12+
/// The configuration key associated with an application name.
13+
/// </summary>
814
public static readonly string ApplicationKey = "applicationName";
15+
16+
/// <summary>
17+
/// The configuration key associated with the startup assembly.
18+
/// </summary>
919
public static readonly string StartupAssemblyKey = "startupAssembly";
20+
21+
/// <summary>
22+
/// The configuration key associated with "hostingStartupAssemblies" configuration.
23+
/// </summary>
1024
public static readonly string HostingStartupAssembliesKey = "hostingStartupAssemblies";
25+
26+
/// <summary>
27+
/// The configuration key associated with the "hostingStartupExcludeAssemblies" configuration.
28+
/// </summary>
1129
public static readonly string HostingStartupExcludeAssembliesKey = "hostingStartupExcludeAssemblies";
1230

31+
/// <summary>
32+
/// The configuration key associated with the "DetailedErrors" configuration.
33+
/// </summary>
34+
1335
public static readonly string DetailedErrorsKey = "detailedErrors";
36+
37+
/// <summary>
38+
/// The configuration key associated with the application's environment setting.
39+
/// </summary>
1440
public static readonly string EnvironmentKey = "environment";
41+
42+
/// <summary>
43+
/// The configuration key associated with the "webRoot" configuration.
44+
/// </summary>
1545
public static readonly string WebRootKey = "webroot";
46+
47+
/// <summary>
48+
/// The configuration key associated with the "captureStartupErrors" configuration.
49+
/// </summary>
1650
public static readonly string CaptureStartupErrorsKey = "captureStartupErrors";
51+
52+
/// <summary>
53+
/// The configuration key associated with the "urls" configuration.
54+
/// </summary>
1755
public static readonly string ServerUrlsKey = "urls";
56+
57+
/// <summary>
58+
/// The configuration key associated with the "ContentRoot" configuration.
59+
/// </summary>
1860
public static readonly string ContentRootKey = "contentRoot";
61+
62+
/// <summary>
63+
/// The configuration key associated with the "PreferHostingUrls" configuration.
64+
/// </summary>
1965
public static readonly string PreferHostingUrlsKey = "preferHostingUrls";
66+
67+
/// <summary>
68+
/// The configuration key associated with the "PreventHostingStartup" configuration.
69+
/// </summary>
2070
public static readonly string PreventHostingStartupKey = "preventHostingStartup";
71+
72+
/// <summary>
73+
/// The configuration key associated with the "SuppressStatusMessages" configuration.
74+
/// </summary>
2175
public static readonly string SuppressStatusMessagesKey = "suppressStatusMessages";
2276

77+
/// <summary>
78+
/// The configuration key associated with the "ShutdownTimeoutSeconds" configuration.
79+
/// </summary>
2380
public static readonly string ShutdownTimeoutKey = "shutdownTimeoutSeconds";
81+
82+
/// <summary>
83+
/// The configuration key associated with the "StaticWebAssets" configuration.
84+
/// </summary>
2485
public static readonly string StaticWebAssetsKey = "staticWebAssets";
2586
}
2687
}

src/Hosting/Hosting/src/Builder/ApplicationBuilderFactory.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,27 @@
99

1010
namespace Microsoft.AspNetCore.Hosting.Builder
1111
{
12+
/// <summary>
13+
/// A factory for creating <see cref="IApplicationBuilder" /> instances.
14+
/// </summary>
1215
public class ApplicationBuilderFactory : IApplicationBuilderFactory
1316
{
1417
private readonly IServiceProvider _serviceProvider;
1518

19+
/// <summary>
20+
/// Initialize a new factory instance with an <see cref="IServiceProvider" />.
21+
/// </summary>
22+
/// <param name="serviceProvider">The <see cref="IServiceProvider"/> used to resolve dependencies and initialize components.</param>
1623
public ApplicationBuilderFactory(IServiceProvider serviceProvider)
1724
{
1825
_serviceProvider = serviceProvider;
1926
}
2027

28+
/// <summary>
29+
/// Create an <see cref="IApplicationBuilder" /> builder given a <paramref name="serverFeatures" />.
30+
/// </summary>
31+
/// <param name="serverFeatures">An <see cref="IFeatureCollection"/> of HTTP features.</param>
32+
/// <returns>An <see cref="IApplicationBuilder"/> configured with <paramref name="serverFeatures"/>.</returns>
2133
public IApplicationBuilder CreateBuilder(IFeatureCollection serverFeatures)
2234
{
2335
return new ApplicationBuilder(_serviceProvider, serverFeatures);

src/Hosting/Hosting/src/Builder/IApplicationBuilderFactory.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66

77
namespace Microsoft.AspNetCore.Hosting.Builder
88
{
9+
/// <summary>
10+
/// Provides an interface for implementing a factory that produces <see cref="IApplicationBuilder"/> instances.
11+
/// </summary>
912
public interface IApplicationBuilderFactory
1013
{
14+
/// <summary>
15+
/// Create an <see cref="IApplicationBuilder" /> builder given a <paramref name="serverFeatures" />
16+
/// </summary>
17+
/// <param name="serverFeatures">An <see cref="IFeatureCollection"/> of HTTP features.</param>
18+
/// <returns>An <see cref="IApplicationBuilder"/> configured with <paramref name="serverFeatures"/>.</returns>
1119
IApplicationBuilder CreateBuilder(IFeatureCollection serverFeatures);
1220
}
13-
}
21+
}

0 commit comments

Comments
 (0)