Пример #1
0
        public void Handle(CreateBusEventRequest command)
        {
            this.ValidateCreateBusEventRequest(command);
            BusEventAggregate aggregate = AggregateFactory.Create <BusEventAggregate>();

            aggregate.CreateEventContent(command.Key, command.Content);
            using (IUnitOfWork uow = this.CreateUnitOfWork <BusEventAggregate>())
            {
                Repository.IBusEventRepository repo = IoC.Container.Resolve <Repository.IBusEventRepository>(uow);
                repo.Add(aggregate);
                uow.Commit();
                aggregate.PublishEvents();
            }
        }
Пример #2
0
 public CreateMessageBusEventResponse CreateMessage(CreateBusEventRequest ev)
 {
     this.Execute(ev);
     /// need to consider how to return response data to caller
     return(new CreateMessageBusEventResponse());
 }
Пример #3
0
        private void ValidateCreateBusEventRequest(CreateBusEventRequest command)
        {
            IValidationException validation = ValidationHelper.Validate(command);

            validation.ThrowIfError();
        }