Exemple #1
0
        public override Marten.Events.StreamState Resolve(Marten.Internal.IMartenSession session, System.Data.Common.DbDataReader reader)
        {
            var streamState = new Marten.Events.StreamState();
            var id          = reader.GetFieldValue <System.Guid>(0);

            streamState.Id = id;
            var version = reader.GetFieldValue <long>(1);

            streamState.Version = version;
            SetAggregateType(streamState, reader, session);
            var lastTimestamp = reader.GetFieldValue <System.DateTimeOffset>(3);

            streamState.LastTimestamp = lastTimestamp;
            var created = reader.GetFieldValue <System.DateTimeOffset>(4);

            streamState.Created = created;
            var isArchived = reader.GetFieldValue <bool>(5);

            streamState.IsArchived = isArchived;
            return(streamState);
        }
Exemple #2
0
        public override async System.Threading.Tasks.Task <Marten.Events.StreamState> ResolveAsync(Marten.Internal.IMartenSession session, System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token)
        {
            var streamState = new Marten.Events.StreamState();
            var id          = await reader.GetFieldValueAsync <System.Guid>(0, token).ConfigureAwait(false);

            streamState.Id = id;
            var version = await reader.GetFieldValueAsync <long>(1, token).ConfigureAwait(false);

            streamState.Version = version;
            await SetAggregateTypeAsync(streamState, reader, session, token);

            var lastTimestamp = await reader.GetFieldValueAsync <System.DateTimeOffset>(3, token).ConfigureAwait(false);

            streamState.LastTimestamp = lastTimestamp;
            var created = await reader.GetFieldValueAsync <System.DateTimeOffset>(4, token).ConfigureAwait(false);

            streamState.Created = created;
            var isArchived = await reader.GetFieldValueAsync <bool>(5, token).ConfigureAwait(false);

            streamState.IsArchived = isArchived;
            return(streamState);
        }