static TimeoutData MapToTimeoutData(TimeoutEntity te)
        {
            if (te == null)
            {
                return(null);
            }

            return(new TimeoutData
            {
                Destination = te.Destination,
                Id = te.Id.ToString(),
                SagaId = te.SagaId,
                State = te.State,
                Time = te.Time,
                Headers = ConvertStringToDictionary(te.Headers),
            });
        }
        public async Task Add(TimeoutData timeout, ContextBag context)
        {
            using (var session = await OpenSession(context).ConfigureAwait(false))
            {
                var timeoutEntity = new TimeoutEntity
                {
                    Destination = timeout.Destination,
                    SagaId      = timeout.SagaId,
                    State       = timeout.State,
                    Time        = timeout.Time,
                    Headers     = ConvertDictionaryToString(timeout.Headers),
                    Endpoint    = timeout.OwningTimeoutManager
                };

                var timeoutId = (Guid)session.Session().Save(timeoutEntity);
                await session.CompleteAsync().ConfigureAwait(false);

                timeout.Id = timeoutId.ToString();
            }
        }
        static TimeoutData MapToTimeoutData(TimeoutEntity te)
        {
            if (te == null)
            {
                return null;
            }

            return new TimeoutData
            {
                Destination = te.Destination,
                Id = te.Id.ToString(),
                SagaId = te.SagaId,
                State = te.State,
                Time = te.Time,
                Headers = ConvertStringToDictionary(te.Headers),
            };
        }