Share via


DistributedSession Konstruktoren

Definition

Überlädt

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

Initialisiert eine neue Instanz von 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)

Parameter

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

Gilt für:

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

Quelle:
DistributedSession.cs
Quelle:
DistributedSession.cs

Initialisiert eine neue Instanz von 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)

Parameter

cache
IDistributedCache

Der IDistributedCache , der zum Speichern der Sitzungsdaten verwendet wird.

sessionKey
String

Ein eindeutiger Schlüssel, der zum Suchen der Sitzung verwendet wird.

idleTimeout
TimeSpan

Gibt an, wie lange die Sitzung inaktiv sein kann (z. B. nicht darauf zugegriffen wird), bevor sie abläuft.

ioTimeout
TimeSpan

Die maximale Zeitspanne LoadAsync(CancellationToken) und CommitAsync(CancellationToken) die zulässige Dauer.

tryEstablishSession
Func<Boolean>

Ein Rückruf, der während Set(String, Byte[]) aufgerufen wird, um zu überprüfen, ob das Ändern der Sitzung aktuell gültig ist. Wenn der Rückruf zurückgibt false, Set(String, Byte[]) löst eine aus InvalidOperationException. SessionMiddleware stellt einen Rückruf bereit, der zurückgibt false , wenn die Sitzung vor dem Senden der Antwort nicht eingerichtet wurde.

loggerFactory
ILoggerFactory

Die ILoggerFactory.

isNewSessionKey
Boolean

true wenn eine neue Sitzung festgelegt wird; false , wenn eine Sitzung fortgesetzt wird.

Gilt für: