From 50f066579a96c6f2b2a4c47524c684e1ef3dfdf0 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 8 Sep 2016 08:46:31 -0700 Subject: [PATCH] Use TaskCache class from Microsoft.Extensions.TaskCache.Sources (#257) Instead of Task.FromResult(0) --- .../AuthenticationHandler.cs | 17 +++++++++-------- .../project.json | 4 ++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/AuthenticationHandler.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/AuthenticationHandler.cs index ff2196771a..eb6b9ad155 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/AuthenticationHandler.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/AuthenticationHandler.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication; +using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Server.IISIntegration { @@ -49,8 +50,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { return PriorHandler.AuthenticateAsync(context); } - - return Task.FromResult(0); + + return TaskCache.CompletedTask; } public Task ChallengeAsync(ChallengeContext context) @@ -86,8 +87,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { return PriorHandler.ChallengeAsync(context); } - - return Task.FromResult(0); + + return TaskCache.CompletedTask; } public void GetDescriptions(DescribeSchemesContext context) @@ -110,8 +111,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { return PriorHandler.SignInAsync(context); } - - return Task.FromResult(0); + + return TaskCache.CompletedTask; } public Task SignOutAsync(SignOutContext context) @@ -121,8 +122,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { return PriorHandler.SignOutAsync(context); } - - return Task.FromResult(0); + + return TaskCache.CompletedTask; } private bool ShouldHandleScheme(string authenticationScheme) diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/project.json b/src/Microsoft.AspNetCore.Server.IISIntegration/project.json index 41ba2e0795..405e66b6e4 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/project.json +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/project.json @@ -29,6 +29,10 @@ "Microsoft.Extensions.SecurityHelper.Sources": { "type": "build", "version": "1.1.0-*" + }, + "Microsoft.Extensions.TaskCache.Sources": { + "version": "1.1.0-*", + "type": "build" } }, "frameworks": {