Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 39b281e

Browse files
committed
Add IsAvailable property to ISession #634
1 parent 8f233ea commit 39b281e

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ nuget.exe
2727
project.lock.json
2828
.build/
2929
.testPublish/
30+
/.vs/

src/Microsoft.AspNetCore.Http.Features/ISession.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ namespace Microsoft.AspNetCore.Http
88
{
99
public interface ISession
1010
{
11+
/// <summary>
12+
/// Indicate whether the current session has loaded correctly.
13+
/// </summary>
14+
bool IsAvailable { get; }
15+
1116
/// <summary>
1217
/// A unique identifier for the current session. This is not the same as the session cookie
1318
/// since the cookie lifetime may not be the same as the session entry lifetime in the data store.

test/Microsoft.AspNetCore.Http.Tests/DefaultHttpContextTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ private Dictionary<string, byte[]> _store
288288

289289
public string Id { get; set; }
290290

291+
public bool IsAvailable { get; } = true;
292+
291293
public IEnumerable<string> Keys { get { return _store.Keys; } }
292294

293295
public void Clear()

0 commit comments

Comments
 (0)