Пример #1
0
        protected virtual void BaseHandle <TCommand>(TCommand command) where TCommand : class
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            OutputHelper.WriteLine($"{DateTime.Now}: {GetType().Name} executed command of type {command.GetType().Name}.");
            InternalHandledCommands.Add(command);
        }
Пример #2
0
 public bool HasHandledCommand <TCommand>()
 {
     return(InternalHandledCommands.Any(c => c is TCommand));
 }