Ejemplo n.º 1
0
 /// <summary>
 /// Adds the events.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="domainEvents">The domain events.</param>
 /// <returns></returns>
 public AggregateRoot <TEntity, TId> AddEvents(TId id, IEnumerable <IDomainEvent <TEntity> > domainEvents)
 {
     return(Factory.GetAndApplyEvents(id, domainEvents, (root, @event) => RefuseEngine.Refuse(root, @event)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Applies the event.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="domainEvent">The domain event.</param>
 public AggregateRoot <TEntity, TId> AddEvent(TId id, IDomainEvent <TEntity> domainEvent)
 {
     return(Factory.GetAndApplyEvent(id, domainEvent, (root, @event) => RefuseEngine.Refuse(root, @event)));
 }