public void Handle(TCommand command)
        {
            ICommandHandler <TCommand> handler = null;

            try
            {
                ICommandHandler commandHandler = _factory.CreateByName(command.GetType().FullName);
                handler = (ICommandHandler <TCommand>)commandHandler;
                handler.Handle(command);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
            }
        }
Ejemplo n.º 2
0
        public void Handle(TCommand command)
        {
            ICommandHandler <TCommand> handler = null;

            try
            {
                ICommandHandler commandHandler = _factory.CreateByName(command.GetType().FullName);

                handler = (ICommandHandler <TCommand>)commandHandler;
                handler.Handle(command);
            }
            finally
            {
                if (handler != null)
                {
                    _factory.Release(handler);
                }
            }
        }