/// <summary> // 发行 /// </summary> /// <param name="eventArgs"></param> public void Publisher(DomainEventHandler DomainEvent, BaseDomainEventArgs eventArgs) { foreach (Delegate item in DomainEvent.GetInvocationList()) { DomainEventHandlerEntity entity = DomainEventHandlerEntity.CreateNew(item.Target.GetType(), item.Method, eventArgs.GetType(), eventArgs); store.AddDomainEventHandler(entity.objectValue); } }
private void Exec() { lock (lock_obj) { var ObjectValues = store.GetEntities(p => !p.IsRuned); DomainEventHandlerValueObject[] entityArray = new DomainEventHandlerValueObject[ObjectValues.Count]; ObjectValues.CopyTo(entityArray, 0); foreach (var objectValue in entityArray) { var entity = DomainEventHandlerEntity.Create(objectValue); entity.Run(); store.ChangDomainEventHandlerStuts(objectValue); } } }