DistributedSession Costruttori

Definizione

Overload

DistributedSession(IDistributedCache, String, TimeSpan, Func<Boolean>, ILoggerFactory, Boolean)
DistributedSession(IDistributedCache, String, TimeSpan, TimeSpan, Func<Boolean>, ILoggerFactory, Boolean)

Inizializza una nuova istanza di DistributedSession.

DistributedSession(IDistributedCache, String, TimeSpan, Func<Boolean>, ILoggerFactory, Boolean)

public:
 DistributedSession(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ sessionKey, TimeSpan idleTimeout, Func<bool> ^ tryEstablishSession, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool isNewSessionKey);
public DistributedSession (Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string sessionKey, TimeSpan idleTimeout, Func<bool> tryEstablishSession, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool isNewSessionKey);
new Microsoft.AspNetCore.Session.DistributedSession : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * TimeSpan * Func<bool> * Microsoft.Extensions.Logging.ILoggerFactory * bool -> Microsoft.AspNetCore.Session.DistributedSession
Public Sub New (cache As IDistributedCache, sessionKey As String, idleTimeout As TimeSpan, tryEstablishSession As Func(Of Boolean), loggerFactory As ILoggerFactory, isNewSessionKey As Boolean)

Parametri

sessionKey
String
idleTimeout
TimeSpan
tryEstablishSession
Func<Boolean>
loggerFactory
ILoggerFactory
isNewSessionKey
Boolean

Si applica a

DistributedSession(IDistributedCache, String, TimeSpan, TimeSpan, Func<Boolean>, ILoggerFactory, Boolean)

Inizializza una nuova istanza di DistributedSession.

public:
 DistributedSession(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> ^ tryEstablishSession, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool isNewSessionKey);
public DistributedSession (Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool isNewSessionKey);
new Microsoft.AspNetCore.Session.DistributedSession : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * TimeSpan * TimeSpan * Func<bool> * Microsoft.Extensions.Logging.ILoggerFactory * bool -> Microsoft.AspNetCore.Session.DistributedSession
Public Sub New (cache As IDistributedCache, sessionKey As String, idleTimeout As TimeSpan, ioTimeout As TimeSpan, tryEstablishSession As Func(Of Boolean), loggerFactory As ILoggerFactory, isNewSessionKey As Boolean)

Parametri

cache
IDistributedCache

Oggetto IDistributedCache utilizzato per archiviare i dati della sessione.

sessionKey
String

Chiave univoca usata per cercare la sessione.

idleTimeout
TimeSpan

Quanto tempo la sessione può essere inattiva (ad esempio non accessibile) prima della scadenza.

ioTimeout
TimeSpan

La quantità massima di tempo LoadAsync(CancellationToken) e CommitAsync(CancellationToken) sono consentite.

tryEstablishSession
Func<Boolean>

Callback richiamato durante Set(String, Byte[]) per verificare che la modifica della sessione sia attualmente valida. Se il callback restituisce false, Set(String, Byte[]) genera un InvalidOperationExceptionoggetto . SessionMiddleware fornisce un callback che restituisce false se la sessione non è stata stabilita prima di inviare la risposta.

loggerFactory
ILoggerFactory

Oggetto ILoggerFactory.

isNewSessionKey
Boolean

true se si stabilisce una nuova sessione; false se si riprende una sessione.

Si applica a