public void event_name_for_event_type() { var options = new StoreOptions(); var mapping = new EventMapping<MembersJoined>(new EventGraph(options)); mapping.EventTypeName.ShouldBe("members_joined"); }
private void appendEvent(NpgsqlConnection conn, EventMapping eventMapping, Guid stream, IEvent @event) { if (@event.Id == Guid.Empty) { @event.Id = Guid.NewGuid(); } conn.CreateSprocCommand("mt_append_event") .With("stream", stream) .With("stream_type", eventMapping.Stream.StreamTypeName) .With("event_id", @event.Id) .With("event_type", eventMapping.EventTypeName) .With("body", _serializer.ToJson(@event), NpgsqlDbType.Jsonb) .ExecuteNonQuery(); }
private void appendEvent(EventMapping eventMapping, Guid stream, IEvent @event, string streamType) { if (@event.Id == Guid.Empty) { @event.Id = Guid.NewGuid(); } _connection.Execute(cmd => { cmd.CallsSproc("mt_append_event") .With("stream", stream) .With("stream_type", streamType) .With("event_id", @event.Id) .With("event_type", eventMapping.EventTypeName) .With("body", _serializer.ToJson(@event), NpgsqlDbType.Jsonb) .ExecuteNonQuery(); }); }
public void event_name_for_event_type() { var mapping = new EventMapping(new StreamMapping(typeof(Quest)), typeof(MembersJoined)); mapping.EventTypeName.ShouldBe("members_joined"); }