DistributedSession 생성자

정의

오버로드

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

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)

매개 변수

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

적용 대상

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

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)

매개 변수

cache
IDistributedCache

IDistributedCache 세션 데이터를 저장하는 데 사용되는 입니다.

sessionKey
String

세션을 조회하는 데 사용되는 고유 키입니다.

idleTimeout
TimeSpan

세션이 만료되기 전에 비활성(예: 액세스되지 않음)될 수 있는 기간입니다.

ioTimeout
TimeSpan

최대 시간 LoadAsync(CancellationToken)CommitAsync(CancellationToken) 소요가 허용됩니다.

tryEstablishSession
Func<Boolean>

세션 수정이 현재 유효한지 확인하기 위해 호출 Set(String, Byte[]) 된 콜백입니다. 콜백이 를 반환 false하면 가 Set(String, Byte[]) throw됩니다 InvalidOperationException. SessionMiddleware 는 응답을 보내기 전에 세션이 설정되지 않은 경우 를 반환 false 하는 콜백을 제공합니다.

isNewSessionKey
Boolean

true 새 세션을 설정하는 경우 false 세션을 다시 시작하면 입니다.

적용 대상