Add ISession.Id

This commit is contained in:
Chris R 2016-03-04 14:28:20 -08:00
parent 15649b7e31
commit 1f754f65d3
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,10 @@ namespace Microsoft.AspNetCore.Http.Features
{ {
public interface ISession public interface ISession
{ {
string Id { get; }
IEnumerable<string> Keys { get; }
Task LoadAsync(); Task LoadAsync();
Task CommitAsync(); Task CommitAsync();
@ -19,7 +23,5 @@ namespace Microsoft.AspNetCore.Http.Features
void Remove(string key); void Remove(string key);
void Clear(); void Clear();
IEnumerable<string> Keys { get; }
} }
} }

View File

@ -288,6 +288,8 @@ namespace Microsoft.AspNetCore.Http.Internal
private Dictionary<string, byte[]> _store private Dictionary<string, byte[]> _store
= new Dictionary<string, byte[]>(StringComparer.OrdinalIgnoreCase); = new Dictionary<string, byte[]>(StringComparer.OrdinalIgnoreCase);
public string Id { get; set; }
public IEnumerable<string> Keys { get { return _store.Keys; } } public IEnumerable<string> Keys { get { return _store.Keys; } }
public void Clear() public void Clear()