/// <summary>
        /// Adds a page access token to the store.
        /// </summary>
        /// <param name="pageToken">The page token.</param>
        /// <param name="pageData">The page data.</param>
        /// <returns></returns>
        public PageAccessToken Add(PageAccessToken pageToken, PageData pageData)
        {
            EnsurePageAccessRights(pageData);

            Identity identity = Store.Save(pageToken);
            pageToken.Id = identity.ExternalId;
            return pageToken;
        }
        protected PageAccessToken FakePageToken()
        {
            var token = new PageAccessToken
                            {
                                UsageLimit = 3,
                                PageId = 191,
                                WorkId = 585,
                                LanguageBranch = "en",
                                UsageCount = 0,
                                Created = DateTime.Now,
                                Id = Guid.NewGuid(),
                                ExpirationType = TokenExpirationType.UsageLimit
                            };

            return token;
        }
        private void UpdateTokenUsageCount(PageAccessToken pageAccessToken)
        {
            if (pageAccessToken.ExpirationType == TokenExpirationType.AbsoluteExpiry)
                return;

            pageAccessToken.UsageCount++;
            Store.Save(pageAccessToken);
        }
 public PageAccessToken Add(PageAccessToken pageToken, PageData pageData)
 {
     pageToken.Id = Guid.NewGuid();
     return pageToken;
 }