Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Commit 0e4405a

Browse files
committed
Remove usage of TaskCache
1 parent f190151 commit 0e4405a

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

src/Microsoft.AspNetCore.Server.HttpSys/AuthenticationHandler.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Threading.Tasks;
88
using Microsoft.AspNetCore.Authentication;
99
using Microsoft.AspNetCore.Http;
10-
using Microsoft.Extensions.Internal;
1110

1211
namespace Microsoft.AspNetCore.Server.HttpSys
1312
{
@@ -29,13 +28,13 @@ public Task<AuthenticateResult> AuthenticateAsync()
2928
public Task ChallengeAsync(AuthenticationProperties properties)
3029
{
3130
_requestContext.Response.StatusCode = 401;
32-
return TaskCache.CompletedTask;
31+
return Task.CompletedTask;
3332
}
3433

3534
public Task ForbidAsync(AuthenticationProperties properties)
3635
{
3736
_requestContext.Response.StatusCode = 403;
38-
return TaskCache.CompletedTask;
37+
return Task.CompletedTask;
3938
}
4039

4140
public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context)
@@ -48,7 +47,7 @@ public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context)
4847
throw new InvalidOperationException("No RequestContext found.");
4948
}
5049

51-
return TaskCache.CompletedTask;
50+
return Task.CompletedTask;
5251
}
5352

5453
public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties)
@@ -58,7 +57,7 @@ public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties propertie
5857

5958
public Task SignOutAsync(AuthenticationProperties properties)
6059
{
61-
return TaskCache.CompletedTask;
60+
return Task.CompletedTask;
6261
}
6362
}
6463
}

src/Microsoft.AspNetCore.Server.HttpSys/FeatureContext.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using Microsoft.AspNetCore.Http;
1414
using Microsoft.AspNetCore.Http.Features;
1515
using Microsoft.AspNetCore.Http.Features.Authentication;
16-
using Microsoft.Extensions.Internal;
1716
using Microsoft.Net.Http.Headers;
1817

1918
namespace Microsoft.AspNetCore.Server.HttpSys
@@ -553,7 +552,7 @@ internal Task OnCompleted()
553552
{
554553
if (_completed)
555554
{
556-
return TaskCache.CompletedTask;
555+
return Task.CompletedTask;
557556
}
558557
_completed = true;
559558
return NotifyOnCompletedAsync();

src/Microsoft.AspNetCore.Server.HttpSys/Microsoft.AspNetCore.Server.HttpSys.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="$(AspNetCoreVersion)" />
1616
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(AspNetCoreVersion)" />
17-
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
1817
<PackageReference Include="Microsoft.Net.Http.Headers" Version="$(AspNetCoreVersion)" />
1918
<PackageReference Include="Microsoft.Win32.Registry" Version="$(CoreFxVersion)" />
2019
<PackageReference Include="System.Security.Principal.Windows" Version="$(CoreFxVersion)" />

test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/DummyApplication.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
using Microsoft.AspNetCore.Hosting.Server;
77
using Microsoft.AspNetCore.Http;
88
using Microsoft.AspNetCore.Http.Features;
9-
using Microsoft.Extensions.Internal;
109

1110
namespace Microsoft.AspNetCore.Server.HttpSys
1211
{
1312
internal class DummyApplication : IHttpApplication<HttpContext>
1413
{
1514
private readonly RequestDelegate _requestDelegate;
1615

17-
public DummyApplication() : this(context => TaskCache.CompletedTask) { }
16+
public DummyApplication() : this(context => Task.CompletedTask) { }
1817

1918
public DummyApplication(RequestDelegate requestDelegate)
2019
{

0 commit comments

Comments
 (0)