예제 #1
0
        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));
        }
예제 #2
0
파일: Appliable.cs 프로젝트: kogoia/DDD
        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 })
                       ));
        }
예제 #3
0
 public IEnumerable <IDomainEvent> UncommitedEvents()
 {
     // TODO: maybe we need cache
     return(_entity.Appled().Events());
 }