Aracılığıyla paylaş


DistributedSession Oluşturucular

Tanım

Aşırı Yüklemeler

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

yeni bir örneğini DistributedSessionbaşlatır.

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)

Parametreler

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

Şunlara uygulanır

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

Kaynak:
DistributedSession.cs
Kaynak:
DistributedSession.cs
Kaynak:
DistributedSession.cs

yeni bir örneğini DistributedSessionbaşlatır.

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)

Parametreler

cache
IDistributedCache

IDistributedCache Oturum verilerini depolamak için kullanılır.

sessionKey
String

Oturumu ararken kullanılan benzersiz bir anahtar.

idleTimeout
TimeSpan

Oturumun süresi dolmadan önce oturumun ne kadar süreyle devre dışı bırakılacağı (örn. erişilmediği).

ioTimeout
TimeSpan

Maksimum süre LoadAsync(CancellationToken) ve CommitAsync(CancellationToken) izin verilen süre.

tryEstablishSession
Func<Boolean>

Oturumu değiştirmenin geçerli olduğunu doğrulamak için sırasında Set(String, Byte[]) çağrılan bir geri çağırma. Geri arama döndürürse false, Set(String, Byte[]) bir InvalidOperationExceptionoluşturur. SessionMiddleware , yanıtı göndermeden önce oturum kurulmadıysa döndüren false bir geri çağırma sağlar.

isNewSessionKey
Boolean

true yeni oturum kuruyorsanız; false oturum devam ettiriyorsa.

Şunlara uygulanır