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

Commit 830dfcd

Browse files
committed
React to moving IsAvailable to ISession
1 parent a2a6b99 commit 830dfcd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/Microsoft.AspNetCore.Session/DistributedSession.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class DistributedSession : ISession
3030
private readonly ILogger _logger;
3131
private bool _isModified;
3232
private bool _loaded;
33+
private bool _isAvailable;
3334
private bool _isNewSessionKey;
3435
private string _sessionId;
3536
private byte[] _sessionIdBytes;
@@ -71,7 +72,13 @@ public DistributedSession(
7172
_isNewSessionKey = isNewSessionKey;
7273
}
7374

74-
public bool IsAvailable { private set; get; }
75+
public bool IsAvailable
76+
{
77+
get
78+
{
79+
return _isAvailable;
80+
}
81+
}
7582

7683
public string Id
7784
{
@@ -206,12 +213,12 @@ private void Load()
206213
{
207214
_logger.AccessingExpiredSession(_sessionKey);
208215
}
209-
IsAvailable = true;
216+
_isAvailable = true;
210217
}
211218
catch (Exception exception)
212219
{
213220
_logger.SessionCacheReadException(_sessionKey, exception);
214-
IsAvailable = false;
221+
_isAvailable = false;
215222
}
216223
finally
217224
{
@@ -235,7 +242,7 @@ public async Task LoadAsync()
235242
{
236243
_logger.AccessingExpiredSession(_sessionKey);
237244
}
238-
IsAvailable = true;
245+
_isAvailable = true;
239246
_loaded = true;
240247
}
241248
}

0 commit comments

Comments
 (0)