Created
October 31, 2019 11:59
-
-
Save trnktms/4c213e0d4237d801035bb1c396dfaec8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DistributedSessionStoreWithStart : DistributedSessionStore, ISessionStore | |
{ | |
readonly IStartSession _startSession; | |
public DistributedSessionStoreWithStart( | |
IDistributedCache cache, | |
ILoggerFactory loggerFactory, | |
IStartSession startSession) | |
: base(cache, loggerFactory) | |
{ | |
_startSession = startSession; | |
} | |
public new ISession Create( | |
string sessionKey, | |
TimeSpan idleTimeout, | |
TimeSpan ioTimeout, | |
Func<bool> tryEstablishSession, | |
bool isNewSessionKey) | |
{ | |
var session = base.Create(sessionKey, idleTimeout, ioTimeout, tryEstablishSession, isNewSessionKey); | |
if (isNewSessionKey) | |
{ | |
_startSession.InvokeStartSesssionActions(session); | |
} | |
return session; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment