DebugFormat() 공개 메소드

public DebugFormat ( string msg ) : void
msg string
리턴 void
예제 #1
0
        public void LoadsFromHistory(IEnumerable <IEvent> events)
        {
            var myevents = events as IEvent[] ?? events.ToArray();

            if (myevents.Any())
            {
                this.Id = myevents.First().AggregateId;

                Logger.DebugFormat("Loading {0} events from history on {1}", myevents.Count(), this.Id);

                foreach (var e in myevents)
                {
                    this.Apply(e, false);
                }
            }
            else
            {
                Logger.DebugFormat("Loaded empty aggregate on id {0}", this.Id);
            }
        }
예제 #2
0
 internal void Mutate(IEvent e)
 {
     Logger.DebugFormat("Apply state {0} (mutate)", e);
     // .NET magic to call one of the 'When' handlers with
     // matching signature
     try
     {
         ((dynamic)this).When((dynamic)e);
     }
     catch (RuntimeBinderException)
     {
         throw new Exception(string.Format("The State {0} should implement IStateEvent<{1}> even if no state change is required", this.GetType().FullName, e.GetType().Name));
     }
 }