/// <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); }
public async Task Add(TAggregate aggregate) { var streamName = StreamNameFor(aggregate.Id); _eventStore.CreateNewStream(streamName, aggregate.GetUncommittedEvents()); _eventStore.AddSnapshot <TAggregate>(streamName, aggregate); aggregate.MarkEventsAsCommitted(); }
public void Create(TAggregate aggregate) { var changes = aggregate.GetUncommitedChanges(); var streamName = StreamNameFor(aggregate); m_eventStore.CreateNewStream(streamName, changes); aggregate.MarkChangesAsCommited(); }
/// <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); }
public void Add(BankAccount bankAccount) { var streamName = StreamFor(bankAccount.Id); _eventStore.CreateNewStream(streamName, bankAccount.Changes); }
/// <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); }
public void Add(TEntity entity) { var streamName = StreamNameFor(entity.Id); _eventStore.CreateNewStream(streamName, entity.Changes); }
public void Add(PayAsYouGoAccount payAsYouGoAccount) { var streamName = StreamNameFor(payAsYouGoAccount.Id); _eventStore.CreateNewStream(streamName, payAsYouGoAccount.Changes); }