DistributedSession Konstruktory
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
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)
Parametry
- cache
- IDistributedCache
- sessionKey
- String
- idleTimeout
- TimeSpan
- loggerFactory
- ILoggerFactory
- isNewSessionKey
- Boolean
Platí pro
DistributedSession(IDistributedCache, String, TimeSpan, TimeSpan, Func<Boolean>, ILoggerFactory, Boolean)
Inicializuje novou instanci .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)
Parametry
- cache
- IDistributedCache
Používá IDistributedCache se k ukládání dat relace.
- sessionKey
- String
Jedinečný klíč použitý k vyhledání relace.
- idleTimeout
- TimeSpan
Jak dlouho může být relace neaktivní (např. nepřístupná) před vypršením platnosti relace.
- ioTimeout
- TimeSpan
Maximální doba LoadAsync(CancellationToken) a CommitAsync(CancellationToken) je povolená.
Zpětné volání vyvolané během Set(String, Byte[]) ověření, že úprava relace je aktuálně platná.
Pokud se zpětné volání vrátí false, Set(String, Byte[]) vyvolá InvalidOperationExceptionchybu .
SessionMiddleware poskytuje zpětné volání, které vrátí false , pokud relace nebyla vytvořena před odesláním odpovědi.
- loggerFactory
- ILoggerFactory
Hodnota ILoggerFactory
- isNewSessionKey
- Boolean
true v případě vytvoření nové relace; false pokud znovu spustíte relaci.