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; } }
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; } }