public ActionResult BuildException(IExceptionConfig exceptionConfig) { string viewName = ((ViewException)exceptionConfig).ViewName; IActionResultBuilder resultBuilder = ActionResultBuilderFactory.Create(exceptionConfig.ResponseType, viewName); return(resultBuilder.Build(exceptionConfig.ErrorData)); }
public ActionResult About2(AboutQueryModel2 query) { ViewData["Message"] = "Your application description page."; return(_actionResultBuilder.Build(new AboutQueryModel(), z => z .Returning <AboutViewModel>() .OnSuccess(x => View("About", x)))); }
public static ActionResult HandleException(FrameworkException frameworkException, IExecutionContext executionCtx, ISessionContext sessionCtx) { IExceptionConfig expConfig = ExceptionBag.Get(frameworkException.ErrorId.ToString()); IActionResultBuilder exceptionBuilder = ActionResultBuilderFactory.Create(expConfig.ResponseType, null); ExceptionCommand exceptionCommand = new ExceptionCommand(expConfig); ExceptionViewModel exceptionModel = exceptionCommand.Get(executionCtx, sessionCtx); return(exceptionBuilder.Build(exceptionModel)); }
public ActionResult BuildException(IExceptionConfig exceptionConfig) { JsonErrorMessage exceptionMessage = new JsonErrorMessage() { Message = (exceptionConfig as JsonException).ErrorData.ToString(), ActionCommand = (exceptionConfig as JsonException).ActionConfig }; IActionResultBuilder resultBuilder = ActionResultBuilderFactory.Create(ResponseType, null); return(resultBuilder.Build(exceptionMessage)); }
private void ExecuteProcess() { try { TOutput response = _command.Process(_executionCtx, _sessionCtx, _viewModel); _actionResult = _resultBuilder.Build(response); } catch (ModuleException moduleException) { throw _command.ExceptionHandler(moduleException); } catch (Exception exception) { throw _command.UIExceptionHandler(exception); } }
private void ExecuteProcess() { try { TOutput response = _command.Get(_executionCtx, _sessionCtx); //Setting the configuration key in model from the command if (response != null) { response.ConfigurationKey = _command.GetConfigurationKey(); } _actionResult = _resultBuilder.Build(response); } catch (ModuleException moduleException) { throw _command.ExceptionHandler(moduleException); } catch (Exception exception) { throw _command.UIExceptionHandler(exception); } }