Пример #1
0
        public override async System.Threading.Tasks.Task ApplyReaderDataToEventAsync(System.Data.Common.DbDataReader reader, Marten.Events.IEvent e, System.Threading.CancellationToken token)
        {
            if (!(await reader.IsDBNullAsync(3, token).ConfigureAwait(false)))
            {
                var sequence = await reader.GetFieldValueAsync <long>(3, token).ConfigureAwait(false);

                e.Sequence = sequence;
            }
            if (!(await reader.IsDBNullAsync(4, token).ConfigureAwait(false)))
            {
                var id = await reader.GetFieldValueAsync <System.Guid>(4, token).ConfigureAwait(false);

                e.Id = id;
            }
            var streamId = await reader.GetFieldValueAsync <System.Guid>(5, token).ConfigureAwait(false);

            e.StreamId = streamId;
            if (!(await reader.IsDBNullAsync(6, token).ConfigureAwait(false)))
            {
                var version = await reader.GetFieldValueAsync <long>(6, token).ConfigureAwait(false);

                e.Version = version;
            }
            if (!(await reader.IsDBNullAsync(7, token).ConfigureAwait(false)))
            {
                var timestamp = await reader.GetFieldValueAsync <System.DateTimeOffset>(7, token).ConfigureAwait(false);

                e.Timestamp = timestamp;
            }
            if (!(await reader.IsDBNullAsync(8, token).ConfigureAwait(false)))
            {
                var tenantId = await reader.GetFieldValueAsync <string>(8, token).ConfigureAwait(false);

                e.TenantId = tenantId;
            }
            var isArchived = await reader.GetFieldValueAsync <bool>(9, token).ConfigureAwait(false);

            e.IsArchived = isArchived;
        }
Пример #2
0
 public override Marten.Internal.Operations.IStorageOperation AppendEvent(Marten.Events.EventGraph events, Marten.Internal.IMartenSession session, Marten.Events.StreamAction stream, Marten.Events.IEvent e)
 {
     return(new Marten.Generated.EventStore.AppendEventOperation(stream, e));
 }
Пример #3
0
        public override void ApplyReaderDataToEvent(System.Data.Common.DbDataReader reader, Marten.Events.IEvent e)
        {
            if (!reader.IsDBNull(3))
            {
                var sequence = reader.GetFieldValue <long>(3);
                e.Sequence = sequence;
            }
            if (!reader.IsDBNull(4))
            {
                var id = reader.GetFieldValue <System.Guid>(4);
                e.Id = id;
            }
            var streamId = reader.GetFieldValue <System.Guid>(5);

            e.StreamId = streamId;
            if (!reader.IsDBNull(6))
            {
                var version = reader.GetFieldValue <long>(6);
                e.Version = version;
            }
            if (!reader.IsDBNull(7))
            {
                var timestamp = reader.GetFieldValue <System.DateTimeOffset>(7);
                e.Timestamp = timestamp;
            }
            if (!reader.IsDBNull(8))
            {
                var tenantId = reader.GetFieldValue <string>(8);
                e.TenantId = tenantId;
            }
            var isArchived = reader.GetFieldValue <bool>(9);

            e.IsArchived = isArchived;
        }
Пример #4
0
 public AppendEventOperation(Marten.Events.StreamAction stream, Marten.Events.IEvent e) : base(stream, e)
 {
     _stream = stream;
     _e      = e;
 }