Esempio n. 1
0
        public void Execute(dynamic command)
        {
            try
            {
                dynamic commandHandler = Bootstrapper.GetCommandHandler(command.GetType());

                commandHandler.Handle(command);
            }
            catch (Exception ex)
            {
                Bootstrapper.Log(ex);

                var faultException = WcfExceptionTranslator.CreateFaultExceptionOrNull(ex);

                if (faultException != null)
                {
                    throw faultException;
                }

                throw;
            }
        }
Esempio n. 2
0
        internal static object ExecuteQuery(dynamic query)
        {
            Type queryType = query.GetType();

            dynamic queryHandler = Bootstrapper.GetQueryHandler(query.GetType());

            try
            {
                return(queryHandler.Handle(query));
            }
            catch (Exception ex)
            {
                Bootstrapper.Log(ex);

                var faultException = WcfExceptionTranslator.CreateFaultExceptionOrNull(ex);

                if (faultException != null)
                {
                    throw faultException;
                }

                throw;
            }
        }