Beispiel #1
0
        public void Execute(ICommand command)
        {
            try
            {
                _logger.LogExecuting(command);

                var handlerType = typeof(ICommandHandler <>)
                                  .MakeGenericType(command.GetType());

                dynamic handler = Kernel.Get(handlerType);

                handler.Execute((dynamic)command);

                _logger.LogExecuted(command);
            }
            catch (Exception ex)
            {
                _logger.LogException(ex);

                _dialogService.Show(ex);
            }
        }