Use new HttpContext.Features API.
This commit is contained in:
parent
c8f918681a
commit
06392be333
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNet.Session
|
||||||
|
|
||||||
var feature = new SessionFeature();
|
var feature = new SessionFeature();
|
||||||
feature.Session = _sessionStore.Create(sessionKey, _options.IdleTimeout, tryEstablishSession, isNewSessionKey);
|
feature.Session = _sessionStore.Create(sessionKey, _options.IdleTimeout, tryEstablishSession, isNewSessionKey);
|
||||||
context.SetFeature<ISessionFeature>(feature);
|
context.Features.Set<ISessionFeature>(feature);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNet.Session
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
context.SetFeature<ISessionFeature>(null);
|
context.Features.Set<ISessionFeature>(null);
|
||||||
|
|
||||||
if (feature.Session != null)
|
if (feature.Session != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,7 @@ namespace Microsoft.AspNet.Session
|
||||||
{
|
{
|
||||||
await next();
|
await next();
|
||||||
|
|
||||||
Assert.Null(httpContext.GetFeature<ISessionFeature>());
|
Assert.Null(httpContext.Features.Get<ISessionFeature>());
|
||||||
});
|
});
|
||||||
|
|
||||||
app.UseSession();
|
app.UseSession();
|
||||||
|
|
@ -403,7 +403,7 @@ namespace Microsoft.AspNet.Session
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.True(exceptionThrown);
|
Assert.True(exceptionThrown);
|
||||||
Assert.Null(httpContext.GetFeature<ISessionFeature>());
|
Assert.Null(httpContext.Features.Get<ISessionFeature>());
|
||||||
});
|
});
|
||||||
|
|
||||||
app.UseSession();
|
app.UseSession();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue