Skip to content

Commit b0578d0

Browse files
Ensure OutputCaching generates a documentation file (#55170)
* Ensure OutputCaching generates a documentation file Seems we aren't shipping any API docs for Output Caching 😢 Ideally we'd backport this to 8.0.x but I'm not sure if the mechanics of servicing support it (ref assembly doc file change only). * Naively fix doc comment warnings * Remove unnecessary usings --------- Co-authored-by: Andrew Casey <andrew.casey@microsoft.com>
1 parent ba1fd34 commit b0578d0

7 files changed

+14
-5
lines changed

src/Middleware/OutputCaching/src/IOutputCacheBufferStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Microsoft.AspNetCore.OutputCaching;
88

99
/// <summary>
10-
/// Represents a store for cached responses that uses a <see cref="IBufferWriter{byte}"/> as the target.
10+
/// Represents a store for cached responses that uses a <see cref="IBufferWriter{Byte}"/> as the target.
1111
/// </summary>
1212
public interface IOutputCacheBufferStore : IOutputCacheStore
1313
{

src/Middleware/OutputCaching/src/IOutputCachePolicy.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ public interface IOutputCachePolicy
1313
/// At that point the cache middleware can still be enabled or disabled for the request.
1414
/// </summary>
1515
/// <param name="context">The current request's cache context.</param>
16+
/// <param name="cancellation">The token to monitor for cancellation requests.</param>
1617
ValueTask CacheRequestAsync(OutputCacheContext context, CancellationToken cancellation);
1718

1819
/// <summary>
1920
/// Updates the <see cref="OutputCacheContext"/> before the cached response is used.
2021
/// At that point the freshness of the cached response can be updated.
2122
/// </summary>
2223
/// <param name="context">The current request's cache context.</param>
24+
/// <param name="cancellation">The token to monitor for cancellation requests.</param>
2325
ValueTask ServeFromCacheAsync(OutputCacheContext context, CancellationToken cancellation);
2426

2527
/// <summary>
2628
/// Updates the <see cref="OutputCacheContext"/> before the response is served and can be cached.
2729
/// At that point cacheability of the response can be updated.
2830
/// </summary>
31+
/// <param name="context">The current request's cache context.</param>
32+
/// <param name="cancellation">The token to monitor for cancellation requests.</param>
2933
ValueTask ServeResponseAsync(OutputCacheContext context, CancellationToken cancellation);
3034
}

src/Middleware/OutputCaching/src/Microsoft.AspNetCore.OutputCaching.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<Description>ASP.NET Core middleware for caching HTTP responses on the server.</Description>
55
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
67
<IsAspNetCoreApp>true</IsAspNetCoreApp>
78
<IsPackable>false</IsPackable>
89
<IsTrimmable>true</IsTrimmable>

src/Middleware/OutputCaching/src/OutputCacheContext.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ namespace Microsoft.AspNetCore.OutputCaching;
1010
/// </summary>
1111
public sealed class OutputCacheContext
1212
{
13+
/// <summary>
14+
/// Constructs a new instance of <see cref="OutputCacheContext"/>.
15+
/// </summary>
1316
public OutputCacheContext()
1417
{
1518
}

src/Middleware/OutputCaching/src/OutputCacheEntryFormatter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using System.Collections.Frozen;
66
using System.Diagnostics;
77
using System.Linq;
8-
using System.Runtime.CompilerServices;
9-
using System.Text;
108
using Microsoft.Extensions.Logging;
119
using Microsoft.Extensions.Primitives;
1210
using Microsoft.Net.Http.Headers;

src/Middleware/OutputCaching/src/OutputCachePolicyBuilder.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ public OutputCachePolicyBuilder SetVaryByQuery(string[] queryKeys)
117117
/// <summary>
118118
/// Adds a policy to vary the cached responses by header.
119119
/// </summary>
120-
/// <param name="headerNames">The header names to vary the cached responses by.</param>
120+
/// <param name="headerName">The header name to vary the cached responses by.</param>
121+
/// <param name="headerNames">Additional header names to vary the cached responses by.</param>
121122
public OutputCachePolicyBuilder SetVaryByHeader(string headerName, params string[] headerNames)
122123
{
123124
ArgumentNullException.ThrowIfNull(headerName);
@@ -269,7 +270,7 @@ public OutputCachePolicyBuilder Expire(TimeSpan expiration)
269270
/// <summary>
270271
/// Adds a policy to change the request locking strategy.
271272
/// </summary>
272-
/// <param name="lockResponse">Whether the request should be locked.</param>
273+
/// <param name="enabled">Whether the request should be locked.</param>
273274
/// <remarks>When the default policy is used, locking is enabled by default.</remarks>
274275
public OutputCachePolicyBuilder SetLocking(bool enabled) => AddPolicy(enabled ? LockingPolicy.Enabled : LockingPolicy.Disabled);
275276

src/Middleware/OutputCaching/src/Policies/OutputCacheConventionBuilderExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public static TBuilder CacheOutput<TBuilder>(this TBuilder builder, IOutputCache
4646
/// <summary>
4747
/// Marks an endpoint to be cached using the specified policy builder.
4848
/// </summary>
49+
/// <param name="builder">The <see cref="IEndpointConventionBuilder"/>.</param>
4950
/// <param name="policy">An action on <see cref="OutputCachePolicyBuilder"/>.</param>
5051
public static TBuilder CacheOutput<TBuilder>(this TBuilder builder, Action<OutputCachePolicyBuilder> policy)
5152
where TBuilder : IEndpointConventionBuilder
@@ -54,6 +55,7 @@ public static TBuilder CacheOutput<TBuilder>(this TBuilder builder, Action<Outpu
5455
/// <summary>
5556
/// Marks an endpoint to be cached using the specified policy builder.
5657
/// </summary>
58+
/// <param name="builder">The <see cref="IEndpointConventionBuilder"/>.</param>
5759
/// <param name="policy">An action on <see cref="OutputCachePolicyBuilder"/>.</param>
5860
/// <param name="excludeDefaultPolicy">Whether to exclude the default policy or not.</param>
5961
public static TBuilder CacheOutput<TBuilder>(this TBuilder builder, Action<OutputCachePolicyBuilder> policy, bool excludeDefaultPolicy) where TBuilder : IEndpointConventionBuilder

0 commit comments

Comments
 (0)