private void ApplyEvent(IAggregateEvent evt) { if (!MethodExecutor.ExecuteMethodForSingleParam(this, evt)) { throw new MissingMethodException(string.Format("Aggregate {0} does not support a method that can be called with {1}", this, evt)); } }
private void Execute(IAggregateRoot aggregate, IAggregateCommand command) { try { if (!MethodExecutor.ExecuteMethodForSingleParam(aggregate, command)) { throw new MissingMethodException(string.Format("Aggregate {0} does not support a method that can be called with {1}", aggregate, command)); } } catch (Exception ex) { Debug.WriteLine("Error executing command\n{0}", ex); throw; } }