Beispiel #1
0
        public EventLogItem Apply(IEvent @event)
        {
            var eventMessage = (T)@event;

            var item = new EventLogItem
            {
                Id          = string.Format("EventLogItem/{0}/{1}/{2}", Category, typeof(T).Name, Headers.GetMessageHeader(@event, Headers.MessageId)),
                Category    = Category,
                RaisedAt    = raisedAtFunc(eventMessage),
                Description = descriptionFunc(eventMessage),
                Severity    = severityFunc(eventMessage),
                EventType   = typeof(T).Name,
                RelatedTo   = relatedToLinks.Select(f => f(eventMessage)).ToList()
            };


            return(item);
        }
        public EventLogItem Apply(IDomainEvent @event)
        {
            var eventMessage = (T)@event;
            var eventId      = Guid.NewGuid().ToString();
            var item         = new EventLogItem
            {
                Id          = $"EventLogItem/{Category}/{typeof(T).Name}/{eventId}",
                Category    = Category,
                RaisedAt    = raisedAtFunc(eventMessage),
                Description = descriptionFunc(eventMessage),
                Severity    = severityFunc(eventMessage),
                EventType   = typeof(T).Name,
                RelatedTo   = relatedToLinks.Select(f => f(eventMessage)).Union(
                    relatedToMultiLinks.SelectMany(f => f(eventMessage))
                    ).ToList()
            };

            return(item);
        }