Use TaskCache class from Microsoft.Extensions.TaskCache.Sources (#257)

Instead of Task.FromResult(0)
This commit is contained in:
Pavel Krymets 2016-09-08 08:46:31 -07:00 committed by GitHub
parent 2f397d6f63
commit 50f066579a
2 changed files with 13 additions and 8 deletions

View File

@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.Http.Authentication;
using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Server.IISIntegration namespace Microsoft.AspNetCore.Server.IISIntegration
{ {
@ -50,7 +51,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
return PriorHandler.AuthenticateAsync(context); return PriorHandler.AuthenticateAsync(context);
} }
return Task.FromResult(0); return TaskCache.CompletedTask;
} }
public Task ChallengeAsync(ChallengeContext context) public Task ChallengeAsync(ChallengeContext context)
@ -87,7 +88,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
return PriorHandler.ChallengeAsync(context); return PriorHandler.ChallengeAsync(context);
} }
return Task.FromResult(0); return TaskCache.CompletedTask;
} }
public void GetDescriptions(DescribeSchemesContext context) public void GetDescriptions(DescribeSchemesContext context)
@ -111,7 +112,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
return PriorHandler.SignInAsync(context); return PriorHandler.SignInAsync(context);
} }
return Task.FromResult(0); return TaskCache.CompletedTask;
} }
public Task SignOutAsync(SignOutContext context) public Task SignOutAsync(SignOutContext context)
@ -122,7 +123,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
return PriorHandler.SignOutAsync(context); return PriorHandler.SignOutAsync(context);
} }
return Task.FromResult(0); return TaskCache.CompletedTask;
} }
private bool ShouldHandleScheme(string authenticationScheme) private bool ShouldHandleScheme(string authenticationScheme)

View File

@ -29,6 +29,10 @@
"Microsoft.Extensions.SecurityHelper.Sources": { "Microsoft.Extensions.SecurityHelper.Sources": {
"type": "build", "type": "build",
"version": "1.1.0-*" "version": "1.1.0-*"
},
"Microsoft.Extensions.TaskCache.Sources": {
"version": "1.1.0-*",
"type": "build"
} }
}, },
"frameworks": { "frameworks": {