DistributedSession Oluşturucular
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Aşırı Yüklemeler
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
- cache
- IDistributedCache
- sessionKey
- String
- idleTimeout
- TimeSpan
- 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.
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.
- loggerFactory
- ILoggerFactory
- isNewSessionKey
- Boolean
true
yeni oturum kuruyorsanız; false
oturum devam ettiriyorsa.