/// <summary>
        /// Create a new stream
        /// </summary>
        /// <param name="aggregate">Event sourced aggregate</param>
        /// <returns>Task</returns>
        public void Add(TEventSourced aggregate)
        {
            Contract.Assume(aggregate?.Id != null && !aggregate.Id.Equals(Guid.Empty));

            var streamName = StreamNameFor(aggregate.Id);

            _eventStore.CreateNewStream(streamName);
        }
Exemplo n.º 2
0
        public async Task Add(TAggregate aggregate)
        {
            var streamName = StreamNameFor(aggregate.Id);

            _eventStore.CreateNewStream(streamName, aggregate.GetUncommittedEvents());
            _eventStore.AddSnapshot <TAggregate>(streamName, aggregate);
            aggregate.MarkEventsAsCommitted();
        }
Exemplo n.º 3
0
        public void Create(TAggregate aggregate)
        {
            var changes = aggregate.GetUncommitedChanges();

            var streamName = StreamNameFor(aggregate);

            m_eventStore.CreateNewStream(streamName, changes);

            aggregate.MarkChangesAsCommited();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds the specified Order.
        /// </summary>
        /// <param name="order">The order.</param>
        public void Add(Order order)
        {
            var streamName = StreamNameFor(order.Id);

            _eventStore.CreateNewStream(streamName, order.Changes);
        }
        /// <summary>
        /// Adds the specified Cart.
        /// </summary>
        /// <param name="cart">The cart.</param>
        public void Add(Cart cart)
        {
            var streamName = StreamNameFor(cart.Id);

            _eventStore.CreateNewStream(streamName, cart.Changes);
        }
        public void Add(Customer customer)
        {
            var streamName = StreamNameFor(customer.Id);

            _eventStore.CreateNewStream(streamName, customer.Changes);
        }
Exemplo n.º 7
0
        public void Add(BankAccount bankAccount)
        {
            var streamName = StreamFor(bankAccount.Id);

            _eventStore.CreateNewStream(streamName, bankAccount.Changes);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Adds the specified Product.
        /// </summary>
        /// <param name="Product">The Product.</param>
        public void Add(Product Product)
        {
            var streamName = StreamNameFor(Product.Id);

            _eventStore.CreateNewStream(streamName, Product.Changes);
        }
Exemplo n.º 9
0
        public void Add(TEntity entity)
        {
            var streamName = StreamNameFor(entity.Id);

            _eventStore.CreateNewStream(streamName, entity.Changes);
        }
Exemplo n.º 10
0
        public void Add(PayAsYouGoAccount payAsYouGoAccount)
        {
            var streamName = StreamNameFor(payAsYouGoAccount.Id);

            _eventStore.CreateNewStream(streamName, payAsYouGoAccount.Changes);
        }