示例#1
0
        public virtual void PublishEvents(EntityChangeReport changeReport)
        {
            PublishEventsInternal(changeReport);

            if (changeReport.IsEmpty() || _unitOfWorkManager.Current == null)
            {
                return;
            }

            _unitOfWorkManager.Current.SaveChanges();
        }
示例#2
0
        public Task PublishEventsAsync(EntityChangeReport changeReport, CancellationToken cancellationToken = default(CancellationToken))
        {
            PublishEventsInternal(changeReport);

            if (changeReport.IsEmpty() || _unitOfWorkManager.Current == null)
            {
                return(Task.FromResult(0));
            }

            return(_unitOfWorkManager.Current.SaveChangesAsync(cancellationToken));
        }
        public Task TriggerEventsAsync(EntityChangeReport changeReport)
        {
            TriggerEventsInternal(changeReport);

            if (changeReport.IsEmpty() || _unitOfWorkManager.Current == null)
            {
                return(Task.FromResult(0));
            }

            return(_unitOfWorkManager.Current.SaveChangesAsync());
        }