// Requires an active static lock
 private async Task AddDesignedPageAsync(DesignedPagesDictionaryByUrl designedPagesByUrl, string url, PageDefinition.DesignedPage designedPage)
 {
     designedPagesByUrl.Add(url, designedPage);
     using (ICacheDataProvider staticCacheDP = YetaWF.Core.IO.Caching.GetStaticCacheProvider()) {
         await staticCacheDP.AddAsync(DESIGNEDPAGESKEY, designedPagesByUrl);
     }
 }
            public async Task <DesignedPagesDictionaryByUrl> GetDesignedPagesAsync()
            {
                // get the names of all designed pages
                using (SQLSimpleObject <Guid, DesignedPage> dp = new SQLSimpleObject <Guid, DesignedPage>(Options)) {
                    DataProviderGetRecords <DesignedPage> pages = await dp.GetRecordsAsync(0, 0, null, null);

                    DesignedPagesDictionaryByUrl byUrl = new DesignedPagesDictionaryByUrl();
                    foreach (DesignedPage page in pages.Data)
                    {
                        byUrl.Add(page.Url.ToLower(), new PageDefinition.DesignedPage {
                            PageGuid = page.PageGuid,
                            Url      = page.Url,
                        });
                    }
                    return(byUrl);
                }
            }
            public async Task <DesignedPagesDictionaryByUrl> GetDesignedPagesAsync()
            {
                DesignedPagesDictionaryByUrl byUrl = new DesignedPagesDictionaryByUrl();
                List <Guid> pageGuids = await GetListOfKeysAsync(BaseFolder);

                foreach (var pageGuid in pageGuids)
                {
                    PageDefinition page = await GetAsync(pageGuid);

                    if (page == null)
                    {
                        throw new InternalError("No PageDefinition for guid {0}", pageGuid);
                    }
                    PageDefinition.DesignedPage desPage = new PageDefinition.DesignedPage()
                    {
                        Url = page.Url, PageGuid = page.PageGuid
                    };
                    byUrl.Add(page.Url.ToLower(), desPage);
                }
                return(byUrl);
            }