Remove usage of TaskCache
This commit is contained in:
parent
f5227bd719
commit
3909a5ce88
|
|
@ -4,7 +4,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.Extensions.Internal;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.ResponseCaching.Internal
|
namespace Microsoft.AspNetCore.ResponseCaching.Internal
|
||||||
{
|
{
|
||||||
|
|
@ -86,7 +85,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
|
||||||
public Task SetAsync(string key, IResponseCacheEntry entry, TimeSpan validFor)
|
public Task SetAsync(string key, IResponseCacheEntry entry, TimeSpan validFor)
|
||||||
{
|
{
|
||||||
Set(key, entry, validFor);
|
Set(key, entry, validFor);
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="$(AspNetCoreVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Http" Version="$(AspNetCoreVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="$(AspNetCoreVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="$(AspNetCoreVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.AspNetCore.ResponseCaching.Internal;
|
using Microsoft.AspNetCore.ResponseCaching.Internal;
|
||||||
using Microsoft.Extensions.Internal;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
|
|
@ -314,7 +313,7 @@ namespace Microsoft.AspNetCore.ResponseCaching
|
||||||
{
|
{
|
||||||
return _cache.SetAsync(context.BaseKey, context.CachedVaryByRules, context.CachedResponseValidFor);
|
return _cache.SetAsync(context.BaseKey, context.CachedVaryByRules, context.CachedResponseValidFor);
|
||||||
}
|
}
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async Task FinalizeCacheBodyAsync(ResponseCachingContext context)
|
internal async Task FinalizeCacheBodyAsync(ResponseCachingContext context)
|
||||||
|
|
@ -378,7 +377,7 @@ namespace Microsoft.AspNetCore.ResponseCaching
|
||||||
{
|
{
|
||||||
return FinalizeCacheHeadersAsync(context);
|
return FinalizeCacheHeadersAsync(context);
|
||||||
}
|
}
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void AddResponseCachingFeature(HttpContext context)
|
internal static void AddResponseCachingFeature(HttpContext context)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.Extensions.Internal;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.ResponseCaching.Internal
|
namespace Microsoft.AspNetCore.ResponseCaching.Internal
|
||||||
{
|
{
|
||||||
|
|
@ -170,7 +169,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
|
||||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
Write(buffer, offset, count);
|
Write(buffer, offset, count);
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void WriteByte(byte value)
|
public override void WriteByte(byte value)
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.AspNetCore.ResponseCaching.Internal;
|
using Microsoft.AspNetCore.ResponseCaching.Internal;
|
||||||
using Microsoft.Extensions.Internal;
|
|
||||||
using Microsoft.Extensions.Logging.Testing;
|
using Microsoft.Extensions.Logging.Testing;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
using Microsoft.Net.Http.Headers;
|
using Microsoft.Net.Http.Headers;
|
||||||
|
|
@ -857,7 +856,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Tests
|
||||||
var middleware = TestUtils.CreateTestMiddleware(next: httpContext =>
|
var middleware = TestUtils.CreateTestMiddleware(next: httpContext =>
|
||||||
{
|
{
|
||||||
responseCachingFeatureAdded = httpContext.Features.Get<IResponseCachingFeature>() != null;
|
responseCachingFeatureAdded = httpContext.Features.Get<IResponseCachingFeature>() != null;
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
},
|
},
|
||||||
policyProvider: new TestResponseCachingPolicyProvider
|
policyProvider: new TestResponseCachingPolicyProvider
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.AspNetCore.ResponseCaching.Internal;
|
using Microsoft.AspNetCore.ResponseCaching.Internal;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Internal;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
using Microsoft.Extensions.Logging.Abstractions;
|
||||||
using Microsoft.Extensions.Logging.Testing;
|
using Microsoft.Extensions.Logging.Testing;
|
||||||
|
|
@ -83,7 +82,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Tests
|
||||||
{
|
{
|
||||||
context.Response.Write(uniqueId);
|
context.Response.Write(uniqueId);
|
||||||
}
|
}
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static IResponseCachingKeyProvider CreateTestKeyProvider()
|
internal static IResponseCachingKeyProvider CreateTestKeyProvider()
|
||||||
|
|
@ -169,7 +168,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Tests
|
||||||
{
|
{
|
||||||
if (next == null)
|
if (next == null)
|
||||||
{
|
{
|
||||||
next = httpContext => TaskCache.CompletedTask;
|
next = httpContext => Task.CompletedTask;
|
||||||
}
|
}
|
||||||
if (cache == null)
|
if (cache == null)
|
||||||
{
|
{
|
||||||
|
|
@ -294,7 +293,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Tests
|
||||||
{
|
{
|
||||||
public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation)
|
public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation)
|
||||||
{
|
{
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -383,7 +382,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Tests
|
||||||
public Task SetAsync(string key, IResponseCacheEntry entry, TimeSpan validFor)
|
public Task SetAsync(string key, IResponseCacheEntry entry, TimeSpan validFor)
|
||||||
{
|
{
|
||||||
Set(key, entry, validFor);
|
Set(key, entry, validFor);
|
||||||
return TaskCache.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue