Example #1
0
        protected void Emit(IDomainEvent @event)
        {
            if (_unCommittedEvents.Any(e => e.EventId == @event.EventId))
            {
                return;
            }

            @event.SetProperty(nameof(@event.CreatedOn), DateTimeUtc.Now().Value);

            Apply(@event);
            _unCommittedEvents.Add(@event);
        }