Skip to content

Commit c65d9a1

Browse files
authored
Split redis output-cache pieces from Microsoft.Extensions.Caching.StackExchange.Redis into Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (#50457)
* split SE.Redis OutputCache implementation into new package, Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (it was causing an undesirable framework ref) - remove the output cache functionality and ref from Microsoft.Extensions.Caching.StackExchange.Redis - (simplified API [un]shipped.txt back to single; no change except no more unshipped) - moved functionality to new package (and update eng files accordingly) - new namespace etc; will need API review - in particular, RedisCacheOptions was shared between both APIs; now RedisOutputCacheOptions * update tags * add a startvs.cmd * remove ExcludeFromSourceBuild * revert shipped/unshipped to make CI happy * keep public API file position to minimize PR size * seal RedisOutputCacheOptions * file named incorrectly * unnecessary using directive * remove IOptions<T> from RedisOutputCacheOptions (required using DI in the tests)
1 parent 067d3f5 commit c65d9a1

20 files changed

+237
-89
lines changed

Diff for: AspNetCore.sln

+38
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcFormSample", "src\Mvc\sa
17741774
EndProject
17751775
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.OutputCaching.Microbenchmarks", "src\Middleware\OutputCaching\perf\Microbenchmarks\Microsoft.AspNetCore.OutputCaching.Microbenchmarks.csproj", "{137AD17B-066F-4ED4-80FA-8D21C7B76CA6}"
17761776
EndProject
1777+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.Tests", "src\Middleware\Microsoft.AspNetCore.OutputCaching.StackExchangeRedis\test\Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.Tests.csproj", "{A939893A-B3CD-48F6-80D3-340C8A6E275B}"
1778+
EndProject
1779+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.OutputCaching.StackExchangeRedis", "src\Middleware\Microsoft.AspNetCore.OutputCaching.StackExchangeRedis\src\Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.csproj", "{F232B503-D412-45EE-8B31-EFD46B9FA302}"
1780+
EndProject
17771781
Global
17781782
GlobalSection(SolutionConfigurationPlatforms) = preSolution
17791783
Debug|Any CPU = Debug|Any CPU
@@ -10663,6 +10667,38 @@ Global
1066310667
{137AD17B-066F-4ED4-80FA-8D21C7B76CA6}.Release|x64.Build.0 = Release|Any CPU
1066410668
{137AD17B-066F-4ED4-80FA-8D21C7B76CA6}.Release|x86.ActiveCfg = Release|Any CPU
1066510669
{137AD17B-066F-4ED4-80FA-8D21C7B76CA6}.Release|x86.Build.0 = Release|Any CPU
10670+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
10671+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|Any CPU.Build.0 = Debug|Any CPU
10672+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|arm64.ActiveCfg = Debug|Any CPU
10673+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|arm64.Build.0 = Debug|Any CPU
10674+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|x64.ActiveCfg = Debug|Any CPU
10675+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|x64.Build.0 = Debug|Any CPU
10676+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|x86.ActiveCfg = Debug|Any CPU
10677+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Debug|x86.Build.0 = Debug|Any CPU
10678+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|Any CPU.ActiveCfg = Release|Any CPU
10679+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|Any CPU.Build.0 = Release|Any CPU
10680+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|arm64.ActiveCfg = Release|Any CPU
10681+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|arm64.Build.0 = Release|Any CPU
10682+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|x64.ActiveCfg = Release|Any CPU
10683+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|x64.Build.0 = Release|Any CPU
10684+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|x86.ActiveCfg = Release|Any CPU
10685+
{A939893A-B3CD-48F6-80D3-340C8A6E275B}.Release|x86.Build.0 = Release|Any CPU
10686+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
10687+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|Any CPU.Build.0 = Debug|Any CPU
10688+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|arm64.ActiveCfg = Debug|Any CPU
10689+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|arm64.Build.0 = Debug|Any CPU
10690+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|x64.ActiveCfg = Debug|Any CPU
10691+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|x64.Build.0 = Debug|Any CPU
10692+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|x86.ActiveCfg = Debug|Any CPU
10693+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Debug|x86.Build.0 = Debug|Any CPU
10694+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|Any CPU.ActiveCfg = Release|Any CPU
10695+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|Any CPU.Build.0 = Release|Any CPU
10696+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|arm64.ActiveCfg = Release|Any CPU
10697+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|arm64.Build.0 = Release|Any CPU
10698+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|x64.ActiveCfg = Release|Any CPU
10699+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|x64.Build.0 = Release|Any CPU
10700+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|x86.ActiveCfg = Release|Any CPU
10701+
{F232B503-D412-45EE-8B31-EFD46B9FA302}.Release|x86.Build.0 = Release|Any CPU
1066610702
EndGlobalSection
1066710703
GlobalSection(SolutionProperties) = preSolution
1066810704
HideSolutionNode = FALSE
@@ -11539,6 +11575,8 @@ Global
1153911575
{F7BCD3AD-31E2-4223-B215-851C3D0AB78A} = {B55A5DE1-5AF3-4B18-AF04-C1735B071DA6}
1154011576
{055F86AA-FB37-40CC-B39E-C29CE7547BB7} = {B8825E86-B8EA-4666-B681-C443D027C95D}
1154111577
{137AD17B-066F-4ED4-80FA-8D21C7B76CA6} = {AA5ABFBC-177C-421E-B743-005E0FD1248B}
11578+
{A939893A-B3CD-48F6-80D3-340C8A6E275B} = {AA5ABFBC-177C-421E-B743-005E0FD1248B}
11579+
{F232B503-D412-45EE-8B31-EFD46B9FA302} = {AA5ABFBC-177C-421E-B743-005E0FD1248B}
1154211580
EndGlobalSection
1154311581
GlobalSection(ExtensibilityGlobals) = postSolution
1154411582
SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F}

Diff for: eng/ProjectReferences.props

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
<ProjectReferenceProvider Include="Microsoft.AspNetCore.HttpsPolicy" ProjectPath="$(RepoRoot)src\Middleware\HttpsPolicy\src\Microsoft.AspNetCore.HttpsPolicy.csproj" />
9090
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Localization.Routing" ProjectPath="$(RepoRoot)src\Middleware\Localization.Routing\src\Microsoft.AspNetCore.Localization.Routing.csproj" />
9191
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Localization" ProjectPath="$(RepoRoot)src\Middleware\Localization\src\Microsoft.AspNetCore.Localization.csproj" />
92+
<ProjectReferenceProvider Include="Microsoft.AspNetCore.OutputCaching.StackExchangeRedis" ProjectPath="$(RepoRoot)src\Middleware\Microsoft.AspNetCore.OutputCaching.StackExchangeRedis\src\Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.csproj" />
9293
<ProjectReferenceProvider Include="Microsoft.AspNetCore.MiddlewareAnalysis" ProjectPath="$(RepoRoot)src\Middleware\MiddlewareAnalysis\src\Microsoft.AspNetCore.MiddlewareAnalysis.csproj" />
9394
<ProjectReferenceProvider Include="Microsoft.AspNetCore.OutputCaching" ProjectPath="$(RepoRoot)src\Middleware\OutputCaching\src\Microsoft.AspNetCore.OutputCaching.csproj" />
9495
<ProjectReferenceProvider Include="Microsoft.AspNetCore.RateLimiting" ProjectPath="$(RepoRoot)src\Middleware\RateLimiting\src\Microsoft.AspNetCore.RateLimiting.csproj" />

Diff for: eng/ShippingAssemblies.props

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
<AspNetCoreShippingAssembly Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" />
133133
<AspNetCoreShippingAssembly Include="Microsoft.AspNetCore.HeaderPropagation" />
134134
<AspNetCoreShippingAssembly Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" />
135+
<AspNetCoreShippingAssembly Include="Microsoft.AspNetCore.OutputCaching.StackExchangeRedis" />
135136
<AspNetCoreShippingAssembly Include="Microsoft.AspNetCore.MiddlewareAnalysis" />
136137
<AspNetCoreShippingAssembly Include="Microsoft.AspNetCore.SpaProxy" />
137138
<AspNetCoreShippingAssembly Include="Microsoft.AspNetCore.SpaServices.Extensions" />

Diff for: src/Caching/StackExchangeRedis/src/Microsoft.Extensions.Caching.StackExchangeRedis.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<ItemGroup>
1414
<Reference Include="Microsoft.Extensions.Caching.Abstractions" />
1515
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
16-
<Reference Include="Microsoft.AspNetCore.OutputCaching" Condition="'$(TargetFramework)' != '$(DefaultNetFxTargetFramework)' and '$(TargetFramework)' != 'netstandard2.0'" />
1716
<Reference Include="Microsoft.Extensions.Options" />
1817
<Reference Include="StackExchange.Redis" />
1918
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
#nullable enable
2-
static Microsoft.Extensions.DependencyInjection.StackExchangeRedisCacheServiceCollectionExtensions.AddStackExchangeRedisOutputCache(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action<Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions!>! setupAction) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!

Diff for: src/Caching/StackExchangeRedis/src/StackExchangeRedisCacheServiceCollectionExtensions.cs

-25
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,4 @@ public static IServiceCollection AddStackExchangeRedisCache(this IServiceCollect
3333

3434
return services;
3535
}
36-
37-
#if NET7_0_OR_GREATER
38-
/// <summary>
39-
/// Adds Redis distributed caching services to the specified <see cref="IServiceCollection" />.
40-
/// </summary>
41-
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
42-
/// <param name="setupAction">An <see cref="Action{RedisCacheOptions}"/> to configure the provided
43-
/// <see cref="RedisCacheOptions"/>.</param>
44-
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
45-
public static IServiceCollection AddStackExchangeRedisOutputCache(this IServiceCollection services, Action<RedisCacheOptions> setupAction)
46-
{
47-
ArgumentNullThrowHelper.ThrowIfNull(services);
48-
ArgumentNullThrowHelper.ThrowIfNull(setupAction);
49-
50-
services.AddOptions();
51-
52-
services.Configure(setupAction);
53-
// replace here (Add vs TryAdd) is intentional and part of test conditions
54-
// long-form name qualification is because of the #if conditional; we'd need a matchin #if around
55-
// a using directive, which is messy
56-
services.AddSingleton<AspNetCore.OutputCaching.IOutputCacheStore, RedisOutputCacheStoreImpl>();
57-
58-
return services;
59-
}
60-
#endif
6136
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<Description>Output cache implementation of Microsoft.AspNetCore.OutputCaching.IOutputCacheStore using Redis.</Description>
5+
<TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7+
<PackageTags>cache;outputcache;redis</PackageTags>
8+
<IsPackable>true</IsPackable>
9+
<IsShipping>true</IsShipping>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
14+
<Reference Include="Microsoft.AspNetCore.OutputCaching" />
15+
<Reference Include="Microsoft.Extensions.Options" />
16+
<Reference Include="StackExchange.Redis" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<InternalsVisibleTo Include="Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.Tests" />
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<Compile Include="$(SharedSourceRoot)ThrowHelpers\ArgumentNullThrowHelper.cs" LinkBase="Shared" />
25+
<Compile Include="$(SharedSourceRoot)ThrowHelpers\ObjectDisposedThrowHelper.cs" LinkBase="Shared" />
26+
<Compile Include="$(SharedSourceRoot)CallerArgument\CallerArgumentExpressionAttribute.cs" LinkBase="Shared" />
27+
</ItemGroup>
28+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#nullable enable
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#nullable enable
2+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions
3+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.Configuration.get -> string?
4+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.Configuration.set -> void
5+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.ConfigurationOptions.get -> StackExchange.Redis.ConfigurationOptions?
6+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.ConfigurationOptions.set -> void
7+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.ConnectionMultiplexerFactory.get -> System.Func<System.Threading.Tasks.Task<StackExchange.Redis.IConnectionMultiplexer!>!>?
8+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.ConnectionMultiplexerFactory.set -> void
9+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.InstanceName.get -> string?
10+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.InstanceName.set -> void
11+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.ProfilingSession.get -> System.Func<StackExchange.Redis.Profiling.ProfilingSession!>?
12+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.ProfilingSession.set -> void
13+
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions.RedisOutputCacheOptions() -> void
14+
Microsoft.Extensions.DependencyInjection.StackExchangeRedisOutputCacheServiceCollectionExtensions
15+
static Microsoft.Extensions.DependencyInjection.StackExchangeRedisOutputCacheServiceCollectionExtensions.AddStackExchangeRedisOutputCache(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action<Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheOptions!>! setupAction) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using System.Threading.Tasks;
6+
using Microsoft.Extensions.Options;
7+
using StackExchange.Redis;
8+
using StackExchange.Redis.Configuration;
9+
using StackExchange.Redis.Profiling;
10+
11+
namespace Microsoft.AspNetCore.OutputCaching.StackExchangeRedis;
12+
13+
/// <summary>
14+
/// Configuration options for Redis based output cache.
15+
/// </summary>
16+
public sealed class RedisOutputCacheOptions
17+
{
18+
/// <summary>
19+
/// The configuration used to connect to Redis.
20+
/// </summary>
21+
public string? Configuration { get; set; }
22+
23+
/// <summary>
24+
/// The configuration used to connect to Redis.
25+
/// This is preferred over Configuration.
26+
/// </summary>
27+
public ConfigurationOptions? ConfigurationOptions { get; set; }
28+
29+
/// <summary>
30+
/// Gets or sets a delegate to create the ConnectionMultiplexer instance.
31+
/// </summary>
32+
public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; }
33+
34+
/// <summary>
35+
/// The Redis instance name. Allows partitioning a single backend cache for use with multiple apps/services.
36+
/// If set, the cache keys are prefixed with this value.
37+
/// </summary>
38+
public string? InstanceName { get; set; }
39+
40+
/// <summary>
41+
/// The Redis profiling session
42+
/// </summary>
43+
public Func<ProfilingSession>? ProfilingSession { get; set; }
44+
45+
private bool? _useForceReconnect;
46+
internal bool UseForceReconnect
47+
{
48+
get
49+
{
50+
return _useForceReconnect ??= GetDefaultValue();
51+
static bool GetDefaultValue() =>
52+
AppContext.TryGetSwitch("Microsoft.AspNetCore.Caching.StackExchangeRedis.UseForceReconnect", out var value) && value;
53+
}
54+
set => _useForceReconnect = value;
55+
}
56+
57+
internal ConfigurationOptions GetConfiguredOptions(string libSuffix)
58+
{
59+
var options = ConfigurationOptions?.Clone() ?? ConfigurationOptions.Parse(Configuration!);
60+
61+
// we don't want an initially unavailable server to prevent DI creating the service itself
62+
options.AbortOnConnectFail = false;
63+
64+
if (!string.IsNullOrWhiteSpace(libSuffix))
65+
{
66+
var provider = DefaultOptionsProvider.GetProvider(options.EndPoints);
67+
options.LibraryName = $"{provider.LibraryName} {libSuffix}";
68+
}
69+
return options;
70+
}
71+
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#if NET7_0_OR_GREATER // IOutputCacheStore only exists from net7
5-
64
using System;
75
using Microsoft.Extensions.Logging;
86
using StackExchange.Redis;
97

10-
namespace Microsoft.Extensions.Caching.StackExchangeRedis;
8+
namespace Microsoft.AspNetCore.OutputCaching.StackExchangeRedis;
119

1210
internal partial class RedisOutputCacheStore
1311
{
@@ -17,4 +15,3 @@ internal partial class RedisOutputCacheStore
1715
[LoggerMessage(2, LogLevel.Error, "Fatal error occurred executing redis output-cache GC loop.", EventName = "RedisOutputCacheGCFatalError")]
1816
internal static partial void RedisOutputCacheGCFatalError(ILogger logger, Exception exception);
1917
}
20-
#endif

Diff for: src/Caching/StackExchangeRedis/src/RedisOutputCacheStore.cs renamed to src/Middleware/Microsoft.AspNetCore.OutputCaching.StackExchangeRedis/src/RedisOutputCacheStore.cs

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#if NET7_0_OR_GREATER // IOutputCacheStore only exists from net7
5-
64
using System;
75
using System.Buffers;
86
using System.Collections.Generic;
@@ -13,17 +11,17 @@
1311
using System.Text;
1412
using System.Threading;
1513
using System.Threading.Tasks;
16-
using Microsoft.AspNetCore.OutputCaching;
1714
using Microsoft.AspNetCore.Shared;
1815
using Microsoft.Extensions.Logging;
16+
using Microsoft.Extensions.Logging.Abstractions;
1917
using Microsoft.Extensions.Options;
2018
using StackExchange.Redis;
2119

22-
namespace Microsoft.Extensions.Caching.StackExchangeRedis;
20+
namespace Microsoft.AspNetCore.OutputCaching.StackExchangeRedis;
2321

2422
internal partial class RedisOutputCacheStore : IOutputCacheStore, IOutputCacheBufferStore, IDisposable
2523
{
26-
private readonly RedisCacheOptions _options;
24+
private readonly RedisOutputCacheOptions _options;
2725
private readonly ILogger _logger;
2826
private readonly RedisKey _valueKeyPrefix;
2927
private readonly RedisKey _tagKeyPrefix;
@@ -48,11 +46,11 @@ internal partial class RedisOutputCacheStore : IOutputCacheStore, IOutputCacheBu
4846
private readonly TimeSpan ReconnectErrorThreshold = TimeSpan.FromSeconds(30);
4947

5048
/// <summary>
51-
/// Initializes a new instance of <see cref="RedisCache"/>.
49+
/// Initializes a new instance of <see cref="RedisOutputCacheStore"/>.
5250
/// </summary>
5351
/// <param name="optionsAccessor">The configuration options.</param>
54-
public RedisOutputCacheStore(IOptions<RedisCacheOptions> optionsAccessor) // TODO: OC-specific options?
55-
: this(optionsAccessor, Logging.Abstractions.NullLoggerFactory.Instance.CreateLogger<RedisCache>())
52+
public RedisOutputCacheStore(IOptions<RedisOutputCacheOptions> optionsAccessor) // TODO: OC-specific options?
53+
: this(optionsAccessor, NullLoggerFactory.Instance.CreateLogger<RedisOutputCacheStore>())
5654
{
5755
}
5856

@@ -65,11 +63,11 @@ internal async ValueTask<string> GetConfigurationInfoAsync(CancellationToken can
6563
#endif
6664

6765
/// <summary>
68-
/// Initializes a new instance of <see cref="RedisCache"/>.
66+
/// Initializes a new instance of <see cref="RedisOutputCacheStore"/>.
6967
/// </summary>
7068
/// <param name="optionsAccessor">The configuration options.</param>
7169
/// <param name="logger">The logger.</param>
72-
internal RedisOutputCacheStore(IOptions<RedisCacheOptions> optionsAccessor, ILogger logger)
70+
internal RedisOutputCacheStore(IOptions<RedisOutputCacheOptions> optionsAccessor, ILogger logger)
7371
{
7472
ArgumentNullThrowHelper.ThrowIfNull(optionsAccessor);
7573
ArgumentNullThrowHelper.ThrowIfNull(logger);
@@ -487,4 +485,3 @@ static void ReleaseConnection(IDatabase? cache)
487485
}
488486
}
489487
}
490-
#endif
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#if NET7_0_OR_GREATER // IOutputCacheStore only exists from net7
5-
64
using Microsoft.Extensions.Logging;
75
using Microsoft.Extensions.Options;
86

9-
namespace Microsoft.Extensions.Caching.StackExchangeRedis;
7+
namespace Microsoft.AspNetCore.OutputCaching.StackExchangeRedis;
108

119
internal sealed class RedisOutputCacheStoreImpl : RedisOutputCacheStore
1210
{
13-
public RedisOutputCacheStoreImpl(IOptions<RedisCacheOptions> optionsAccessor, ILogger<RedisCache> logger)
11+
public RedisOutputCacheStoreImpl(IOptions<RedisOutputCacheOptions> optionsAccessor, ILogger<RedisOutputCacheStore> logger)
1412
: base(optionsAccessor, logger)
1513
{
1614
}
1715

18-
public RedisOutputCacheStoreImpl(IOptions<RedisCacheOptions> optionsAccessor)
16+
public RedisOutputCacheStoreImpl(IOptions<RedisOutputCacheOptions> optionsAccessor)
1917
: base(optionsAccessor)
2018
{
2119
}
2220
}
23-
24-
#endif

0 commit comments

Comments
 (0)