async Task Render(String pathInfo, RequestUrlKind kind) { // Ajax if (IsNotAjax()) { return; } try { Response.ContentType = "text/html"; ExpandoObject loadPrms = new ExpandoObject(); loadPrms.Append(_baseController.CheckPeriod(Request.QueryString), toPascalCase: true); if (pathInfo.StartsWith("app/")) { SetUserTenantToParams(loadPrms); // without claims await _baseController.RenderApplicationKind(kind, pathInfo, loadPrms, Response.Output); } else { SetSqlQueryParams(loadPrms); await _baseController.RenderElementKind(kind, pathInfo, loadPrms, Response.Output); } } catch (Exception ex) { _baseController.WriteHtmlException(ex, Response.Output); } }
async Task Render(String pathInfo, RequestUrlKind kind) { /* * PARAMS: * 1. initial = [queryString, controller] * 2. real = [model.json, id, initial] */ // Ajax if (IsNotAjax()) { return; } try { Response.ContentType = "text/html"; ExpandoObject loadPrms = new ExpandoObject(); // query string loadPrms.Append(_baseController.CheckPeriod(Request.QueryString), toPascalCase: true); if (pathInfo.StartsWith("app/")) { // controller after query string SetUserTenantToParams(loadPrms); // without claims await _baseController.RenderApplicationKind(kind, pathInfo, loadPrms, Response.Output); } else { // controller after query string SetSqlQueryParams(loadPrms); await _baseController.RenderElementKind(kind, pathInfo, loadPrms, Response.Output); } } catch (Exception ex) { if (ex.Message.StartsWith("UI:", StringComparison.OrdinalIgnoreCase)) { var error = _baseController.Localize(ex.Message.Substring(3)); _baseController.WriteExceptionStatus(ex, Response); } else { _baseController.WriteHtmlException(ex, Response.Output); } } }