コード例 #1
0
        protected virtual bool Recover(ICommittedEvent <TAggregate, TIdentity, IAggregateEvent <TAggregate, TIdentity> > committedEvent)
        {
            try
            {
                Logger.Debug($"Recovering with event of type [{committedEvent.GetType().PrettyPrint()}] ");
                ApplyEvent(committedEvent.AggregateEvent);
            }
            catch (Exception exception)
            {
                Logger.Error($"Recovering with event of type [{committedEvent.GetType().PrettyPrint()}] caused an exception {exception.GetType().PrettyPrint()}");
                return(false);
            }

            return(true);
        }
コード例 #2
0
ファイル: AggregateSaga.cs プロジェクト: wn-forks/Akkatecture
        protected virtual bool Recover(ICommittedEvent <TAggregateSaga, TIdentity, IAggregateEvent <TAggregateSaga, TIdentity> > committedEvent)
        {
            try
            {
                Log.Debug("AggregateSaga of Name={0}, Id={1}, and Version={2}, is recovering with CommittedEvent of Type={3}.", Name, Id, Version, committedEvent.GetType().PrettyPrint());
                ApplyEvent(committedEvent.AggregateEvent);
            }
            catch (Exception exception)
            {
                Log.Error(exception, "Aggregate of Name={0}, Id={1}; while recovering with event of Type={2} caused an exception.", Name, Id, committedEvent.GetType().PrettyPrint());
                return(false);
            }

            return(true);
        }