Use new HttpContext.Features API.

This commit is contained in:
Chris R 2015-08-31 09:35:08 -07:00
parent c8f918681a
commit 06392be333
2 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ namespace Microsoft.AspNet.Session
var feature = new SessionFeature();
feature.Session = _sessionStore.Create(sessionKey, _options.IdleTimeout, tryEstablishSession, isNewSessionKey);
context.SetFeature<ISessionFeature>(feature);
context.Features.Set<ISessionFeature>(feature);
try
{
@ -77,7 +77,7 @@ namespace Microsoft.AspNet.Session
}
finally
{
context.SetFeature<ISessionFeature>(null);
context.Features.Set<ISessionFeature>(null);
if (feature.Session != null)
{

View File

@ -362,7 +362,7 @@ namespace Microsoft.AspNet.Session
{
await next();
Assert.Null(httpContext.GetFeature<ISessionFeature>());
Assert.Null(httpContext.Features.Get<ISessionFeature>());
});
app.UseSession();
@ -403,7 +403,7 @@ namespace Microsoft.AspNet.Session
}
Assert.True(exceptionThrown);
Assert.Null(httpContext.GetFeature<ISessionFeature>());
Assert.Null(httpContext.Features.Get<ISessionFeature>());
});
app.UseSession();