/// <summary> /// Persiste the session state. /// </summary> /// <typeparam name="TState"></typeparam> /// <param name="state"></param> /// <returns></returns> public async Task SetState <TState>(TState state) where TState : class { using (var stream = new MemoryStream(await _serializer.Serialize(state).ConfigureAwait(false))) { stream.Position = 0; await _session.SetStateAsync(stream) .ConfigureAwait(false); } }
public Task SetStateAsync(Stream sessionState) { return(_session.SetStateAsync(sessionState)); }