Use TaskCache class from Microsoft.Extensions.TaskCache.Sources

This commit is contained in:
John Luo 2016-09-07 11:33:05 -07:00
parent 411681e8d6
commit 02b8fb3bbc
2 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Internal;
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Options;
@ -16,7 +17,7 @@ namespace Microsoft.AspNetCore.ResponseCaching
private static readonly Func<object, Task> OnStartingCallback = state =>
{
((ResponseCachingContext)state).OnResponseStarting();
return Task.FromResult(0);
return TaskCache.CompletedTask;
};
private readonly RequestDelegate _next;

View File

@ -23,7 +23,11 @@
"dependencies": {
"Microsoft.AspNetCore.Http": "1.1.0-*",
"Microsoft.AspNetCore.Http.Extensions": "1.1.0-*",
"Microsoft.Extensions.Caching.Memory": "1.1.0-*"
"Microsoft.Extensions.Caching.Memory": "1.1.0-*",
"Microsoft.Extensions.TaskCache.Sources": {
"version": "1.1.0-*",
"type": "build"
}
},
"frameworks": {
"net451": {},