public async Task Write(TrackingEvent trackingEvent)
        {
            using (var context = _contextFactory())
            {
                context.Set<TrackingEvent>().Add(trackingEvent);

                await context.SaveChangesAsync();
            }
        }
        Task WriteEvent <T>(ConsumeContext <T> context, DateTime timestamp, string text = default(string), Guid?bookingRequestId = default(Guid?),
                            TimeSpan?duration = default(TimeSpan?))
            where T : class
        {
            var trackingEvent = new TrackingEvent
            {
                MessageId        = context.MessageId ?? NewId.NextGuid(),
                Timestamp        = timestamp,
                Duration         = duration,
                Text             = text,
                CorrelationId    = context.CorrelationId,
                ConversationId   = context.ConversationId,
                InitiatorId      = context.InitiatorId,
                BookingRequestId = bookingRequestId,
                EventType        = typeof(T).Name
            };

            return(_writer.Write(trackingEvent));
        }