DistributedSession Konstruktory

Definicja

Przeciążenia

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

Inicjuje nowe wystąpienie klasy 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)

Parametry

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

Dotyczy

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

Źródło:
DistributedSession.cs
Źródło:
DistributedSession.cs

Inicjuje nowe wystąpienie klasy 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

Element IDistributedCache używany do przechowywania danych sesji.

sessionKey
String

Unikatowy klucz używany do wyszukiwania sesji.

idleTimeout
TimeSpan

Jak długo sesja może być nieaktywna (np. nie można uzyskać do niej dostępu), zanim wygaśnie.

ioTimeout
TimeSpan

Maksymalny czas LoadAsync(CancellationToken) i CommitAsync(CancellationToken) są dozwolone.

tryEstablishSession
Func<Boolean>

Wywołanie zwrotne wywoływane podczas sprawdzania Set(String, Byte[]) , czy modyfikowanie sesji jest obecnie prawidłowe. Jeśli wywołanie zwrotne zwróci falsewartość , Set(String, Byte[]) zwraca wartość InvalidOperationException. SessionMiddleware Udostępnia wywołanie zwrotne, które zwraca false informację, jeśli sesja nie została ustanowiona przed wysłaniem odpowiedzi.

loggerFactory
ILoggerFactory

Element ILoggerFactory.

isNewSessionKey
Boolean

true w przypadku ustanowienia nowej sesji; false w przypadku wznowienia sesji.

Dotyczy