public IAggregateRoot <TEventType> Apply(TEventType evnt) { var applied = _entity.Appled(); _ucommetedEvents.ToList().Add((IDomainEvent)evnt.Content()); return(new FakeAggregateRoot <TEntity, TEventType>(_f, _f(applied.Result(), evnt), _ucommetedEvents)); }
public AppliedEventResult <TEntity> Result <TEntity>( Func <TEvent, TEntity, TEntity> whenFunc, IApplicable <TEntity> entity ) { var applied = entity.Appled(); return(new AppliedEventResult <TEntity>( whenFunc((TEvent)_event, applied.Result()), applied .Events() .Concat(new [] { _event }) )); }
public IEnumerable <IDomainEvent> UncommitedEvents() { // TODO: maybe we need cache return(_entity.Appled().Events()); }