Exemple #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();
            }
        }
Exemple #2
0
 public CreateMessageBusEventResponse CreateMessage(CreateBusEventRequest ev)
 {
     this.Execute(ev);
     /// need to consider how to return response data to caller
     return(new CreateMessageBusEventResponse());
 }
Exemple #3
0
        private void ValidateCreateBusEventRequest(CreateBusEventRequest command)
        {
            IValidationException validation = ValidationHelper.Validate(command);

            validation.ThrowIfError();
        }