public static string ServerSidePageHandler(string requestUriPath, IDBService dbProxy, IHttpContextProxy httpProxy, IViewEngine viewEngine, IActionExecuter actionExecuter, ILogger logger, ISessionProvider sessionProvider, IKeyValueStorage keyValueStorage, Dictionary <string, dynamic> pageModel = null)
        {
            var fi   = new FileInfo(requestUriPath);
            var data = ContentHelper.GetStringContent(dbProxy, logger, requestUriPath, keyValueStorage);

            if (data != null)
            {
                if (pageModel == null)
                {
                    pageModel = new Dictionary <string, dynamic>();
                }
                var folderPath = requestUriPath.Replace(fi.Name, "");

                UpdateBaseModel(pageModel, requestUriPath, fi.Name);

                data = viewEngine.Compile(data, requestUriPath, SetDefaultModel(dbProxy, httpProxy, logger, viewEngine, actionExecuter, pageModel, keyValueStorage, sessionProvider, folderPath));
                if (pageModel.ContainsKey(CommonConst.CommonValue.PAGE_TEMPLATE_PATH))
                {
                    FileInfo fiTemplate       = new FileInfo(pageModel[CommonConst.CommonValue.PAGE_TEMPLATE_PATH]);
                    var      templateFileData = ContentHelper.GetStringContent(dbProxy, logger, pageModel[CommonConst.CommonValue.PAGE_TEMPLATE_PATH], keyValueStorage);
                    pageModel[CommonConst.CommonValue.RENDERBODY_DATA] = data;
                    data = viewEngine.Compile(templateFileData, pageModel[CommonConst.CommonValue.PAGE_TEMPLATE_PATH],
                                              ServerPageModelHelper.SetDefaultModel(dbProxy, httpProxy, logger, viewEngine, actionExecuter, pageModel, keyValueStorage, sessionProvider, pageModel[CommonConst.CommonValue.PAGE_TEMPLATE_PATH].Replace(fiTemplate.Name, "")));
                }
                return(data);
            }
            else
            {
                return(null);
            }
        }
        public Task <string> GetStringContentAsync(string path)
        {
            path = ContentHelper.MappedUriPath(path);



            if (CommonUtility.IsServerSidePage(path))
            {
                var response = ServerPageModelHelper.ServerSidePageHandler(path, _dbService, _httpProxy, _viewEngine, _actionExecuter, _logger, _sessionProvider, _keyValueStorage);

                //var data = ContentHelper.GetStringContent(_dbService, _logger, path, _keyValueStorage);
                return(Task.FromResult <string>(response));
                // return response;
                // return Task.FromResult<string>($"In Progress :: {DateTime.Now.ToLongTimeString()}");
            }
            else
            {
                var data = ContentHelper.GetStringContent(_dbService, _logger, path, _keyValueStorage);
                return(Task.FromResult <string>(data));
            }
        }