private string PrefetchModuleInstanceData(string moduleInstanceId)
        {
            var result = new ModuleInstanceApiV1Controller().GetModuleInstanceData(false, moduleInstanceId);

            // Process custom headers
            foreach (var header in result.Headers)
            {
                var headerValue = header.Value.First();

                switch (header.Key)
                {
                    case CommonParameters.SeoData:
                        Response.Headers.Add(header.Key, headerValue);
                        break;

                    case CommonParameters.SeoSchema:
                        ViewData.Add(CommonParameters.SeoSchema, headerValue);
                        break;
                }
            }

            // Process and return instance data
            return result.Content.ReadAsStringAsync().Result;
        }
        private void SetMetaViewData(string moduleInstanceId, string serviceProxyEndpoint, string authToken, string loadOrder, bool? showDiag, bool? showAdmin, bool isConfig)
        {
            var applicationPath = ServiceContext.ServicesBaseUrl;
            var controllerName = "IH_PublicDetailView" + Guid.NewGuid().ToString().Replace("-", "_");
            var moduleInstanceDataVariableName = "moduleInstanceData_" + controllerName;
            var queryString = string.Empty;

            var moduleInstanceData = new ModuleInstanceApiV1Controller().GetMetaModuleInstanceData(isConfig, moduleInstanceId).Content.ReadAsStringAsync().Result;
            ViewData.Add(CommonParameters.ModuleInstanceData, moduleInstanceData);

            var scriptInitData = "{ " + CommonParameters.ApplicationPath + ": '" + applicationPath
                + "', " + CommonParameters.ModuleInstanceId + ": '" + moduleInstanceId
                + "', " + CommonParameters.ModuleInstanceDataVariableName + ": '" + moduleInstanceDataVariableName
                + "', " + CommonParameters.ControllerName + ": '" + controllerName
                + "', " + CommonParameters.ServiceProxyEndpoint + ": '" + serviceProxyEndpoint
                + "', " + CommonParameters.ExtraQueryString + ": '" + queryString
                + "' }";

            ViewData.Add("ScriptInitData", scriptInitData);
        }