public void OnGet() { var infoDc = _chromelyInfo.GetInfo() as IDictionary <string, string>; if (infoDc != null) { Objective = infoDc.ContainsKey("divObjective") ? infoDc["divObjective"] : Objective; Platform = infoDc.ContainsKey("divPlatform") ? infoDc["divPlatform"] : Platform; Version = infoDc.ContainsKey("divVersion") ? infoDc["divVersion"] : Version; } }
public IChromelyResponse Execute(string requestId, string routePath, IDictionary <string, object>?parameters, object?postData, string?requestData) { if (string.IsNullOrWhiteSpace(routePath)) { return(_chromelyErrorHandler.HandleRouteNotFound(requestId, routePath)); } if (routePath.ToLower().Equals("/info")) { return(_chromelyInfo.GetInfo(requestId)); } var route = _routeProvider.GetRoute(routePath); if (route is null) { throw new Exception($"Route for path = {routePath} is null or invalid."); } return(ExecuteRoute(requestId, routePath, parameters, postData, requestData)); }
public IActionResult Index() { Info info = new(); var infoDc = _chromelyInfo.GetInfo() as IDictionary <string, string>; if (infoDc != null) { info.Objective = infoDc.ContainsKey("divObjective") ? infoDc["divObjective"] : info.Objective; info.Platform = infoDc.ContainsKey("divPlatform") ? infoDc["divPlatform"] : info.Platform; info.Version = infoDc.ContainsKey("divVersion") ? infoDc["divVersion"] : info.Version; } return(View(info)); }
public IChromelyResponse Run(string routeUrl, IDictionary <string, string> parameters, object postData) { if (string.IsNullOrWhiteSpace(routeUrl)) { return(_chromelyErrorHandler.HandleRouteNotFound(string.Empty, routeUrl)); } if (routeUrl.ToLower().Equals("/info")) { return(_chromelyInfo?.GetInfo(string.Empty)); } var route = _routeProvider.GetActionRoute(routeUrl); if (route == null) { throw new Exception($"Route for path = {routeUrl} is null or invalid."); } return(ExecuteRoute(string.Empty, routeUrl, parameters, postData, string.Empty)); }