public bool Delete() { string routingKey = "DeleteProductUnityEvent"; CreateProductUnityEventJson jsonObject = this.CreateJsonObject(routingKey); // Add to the EventStore return(RepositoryFactory <CreateProductUnityEventJson> .Create().Append(jsonObject)); }
private CreateProductUnityEventJson CreateJsonObject(string routingKey) { CreateProductUnityEventJson jsonObject = new CreateProductUnityEventJson(); jsonObject.Event = routingKey; jsonObject.Id = this.id; jsonObject.Name = this.name; jsonObject.Description = this.description; return(jsonObject); }
public bool Create() { string routingKey = "CreateProductUnityEvent"; CreateProductUnityEventJson jsonObject = this.CreateJsonObject(routingKey); // Add to the EventStore bool stored = RepositoryFactory <CreateProductUnityEventJson> .Create().Append(jsonObject); // Publish to RabbitMQ if (stored) { jsonObject.Event = null; IProducerAttributes attributes = ProducerAttributesFactory <CreateProductUnityEventJson> .Create(routingKey, jsonObject); EventBusQueueProducer producer = new EventBusQueueProducer(); producer.Publish(attributes); } return(stored); }