/// <inheritdoc />
        public DBResult <GenericCache> AddCacheObject(GenericCache cacheObject, bool commit = true)
        {
            this.logger.LogTrace("Adding GenericCache object to DB...");
            DBResult <GenericCache> result = new DBResult <GenericCache>()
            {
                Payload = cacheObject,
                Status  = DBStatusCode.Deferred,
            };

            this.dbContext.GenericCache.Add(cacheObject);
            if (commit)
            {
                try
                {
                    this.dbContext.SaveChanges();
                    result.Status = DBStatusCode.Created;
                }
                catch (DbUpdateException e)
                {
                    this.logger.LogError($"Unable to save note to DB {e.ToString()}");
                    result.Status  = DBStatusCode.Error;
                    result.Message = e.Message;
                }
            }

            this.logger.LogDebug($"Finished adding Cache object in DB with result {result.Status}");
            return(result);
        }
        /// <inheritdoc />
        public DBResult <GenericCache> DeleteCacheObject(GenericCache cacheObject, bool commit = true)
        {
            this.logger.LogTrace("Deleting GenericCache object from DB...");
            DBResult <GenericCache> result = new DBResult <GenericCache>()
            {
                Payload = cacheObject,
                Status  = DBStatusCode.Deferred,
            };

            this.dbContext.GenericCache.Remove(cacheObject);
            this.dbContext.Entry(cacheObject).Property(p => p.HdId).IsModified = false;
            if (commit)
            {
                try
                {
                    this.dbContext.SaveChanges();
                    result.Status = DBStatusCode.Deleted;
                }
                catch (DbUpdateConcurrencyException e)
                {
                    result.Status  = DBStatusCode.Concurrency;
                    result.Message = e.Message;
                }
            }

            this.logger.LogDebug($"Finished deleting Generic cache object in DB with result {result.Status}");
            return(result);
        }
Ejemplo n.º 3
0
        public frmMain()
        {
            InitializeComponent();
            #if DEBUG
            this.mnuMain_HelpDebug.Checked = true;
            #endif
            this.mnuMain_ScraperThreads.SelectedIndex = 0;
            this.FormClosing += new FormClosingEventHandler(frmMain_FormClosing);

            this._downloader = new ImageDownloader(1);
            this._imageCache = new GenericCache<string, Image>(5);

            // Windows XP visuals fix.
            if (Environment.OSVersion.Version.Major == 5)
            {
                this.grpStatus.Location = new Point(247, 27);
                this.grpStatus.Size -= new Size(0, 6);
                this.grpPostStats.Location = new Point(0, 76);
                this.grpPostStats.Size -= new Size(0, 13);
            }

            this.treePostWindow.TreeViewNodeSorter = new TreeViewComparer();
            #region Tree View Context Menu Setup
            this.cmTree = new ContextMenu();
            this.cmTree.Name = "cmTree";
            this.cmTree.Popup += new EventHandler(this.cmTree_Popup);
            this.cmTree_Rename = new MenuItem("Rename Thread");
            this.cmTree_Rename.Name = "cmTree_Rename";
            this.cmTree_Rename.Click += new EventHandler(cmTree_Rename_Click);
            this.cmTree_Delete = new MenuItem("Delete");
            this.cmTree_Delete.Name = "cmTree_Delete";
            this.cmTree_Delete.Shortcut = Shortcut.Del;
            this.cmTree_Delete.Click += new EventHandler(cmTree_Delete_Click);
            this.cmTree_Rescrape = new MenuItem("Rescrape Thread");
            this.cmTree_Rescrape.Name = "cmTree_Rescrape";
            this.cmTree_Rescrape.Shortcut = Shortcut.CtrlR;
            this.cmTree_Rescrape.Click += new EventHandler(cmTree_Rescrape_Click);
            this.cmTree_Download = new MenuItem("Download");
            this.cmTree_Download.Name = "cmTree_Download";
            this.cmTree_Download.Shortcut = Shortcut.CtrlD;
            this.cmTree_Download.Click += new EventHandler(cmTree_Download_Click);
            this.cmTree_OpenInExplorer = new MenuItem("Show Image in Explorer");
            this.cmTree_OpenInExplorer.Name = "cmTree_OpenInExplorer";
            this.cmTree_OpenInExplorer.Click += new EventHandler(cmTree_OpenInExplorer_Click);
            this.cmTree_GenerateImgUrl = new MenuItem("Copy 4chan Image URL");
            this.cmTree_GenerateImgUrl.Name = "cmTree_GenerateImgUrl";
            this.cmTree_GenerateImgUrl.Click += new EventHandler(cmTree_GenerateImgUrl_Click);
            this.cmTree_GenerateThreadArchive = new MenuItem("Create Thread Archive");
            this.cmTree_GenerateThreadArchive.Name = "cmTree_GenerateThreadArchive";
            this.cmTree_GenerateThreadArchive.Click += new EventHandler(cmTree_GenerateThreadArchive_Click);
            this.cmTree_Sep1 = new MenuItem("-");
            this.cmTree_Sep1.Name = "cmTree_Sep1";
            this.cmTree_Sep2 = new MenuItem("-");
            this.cmTree_Sep2.Name = "cmTree_Sep2";
            this.cmTree__Thread = new MenuItem[] { this.cmTree_Rescrape, this.cmTree_Download, this.cmTree_Sep1, this.cmTree_Rename, this.cmTree_Delete, this.cmTree_Sep2, this.cmTree_GenerateThreadArchive };
            this.cmTree__Post = new MenuItem[] { this.cmTree_Download, this.cmTree_Sep1, this.cmTree_Delete, this.cmTree_Sep2, this.cmTree_OpenInExplorer, this.cmTree_GenerateImgUrl };
            this.cmTree.MenuItems.AddRange(this.cmTree__Thread);
            this.treePostWindow.ContextMenu = this.cmTree;
            #endregion
        }
        public void AddTest()
        {
            GenericCache <int, int> cache = new GenericCache <int, int>();

            cache.Add(1, 1001);
            cache.Add(2, 1002);
            Assert.AreEqual <int>(2, cache.Count);
        }
        public void ContainsKeyTest()
        {
            GenericCache <int, int> cache = new GenericCache <int, int>();

            cache.Add(1, 1001);
            cache.Add(2, 1002);
            Assert.IsTrue(cache.ContainsKey(1));
            Assert.IsFalse(cache.ContainsKey(3));
        }
 public void GenericityCache()
 {
     for (int i = 0; i < 5; i++)
     {
         Console.WriteLine(GenericCache <int> .GetCache());
         Console.WriteLine(GenericCache <long> .GetCache());
         Console.WriteLine(GenericCache <DateTime> .GetCache());
         Console.WriteLine(GenericCache <string> .GetCache());
     }
     Assert.IsTrue(true);
 }
Ejemplo n.º 7
0
 public static void Init(string localePath)
 {
     defaultService = new Lazy<ILocalizingService>(() =>
         {
             var poFileWatcher = new PoFileWatcher(localePath);
             var genericCache = new GenericCache<IDictionary<string, I18NMessage>>();
             poFileWatcher.OnChange +=
                 (o, e) => genericCache.Reset(new ChangeListParser(e.ChangeList).GetChangedCultures());
             poFileWatcher.Begin();
             return new LocalizingService(genericCache, localePath, new I18NPoFileParser());
         }, true);
 }
        public void TryGetValueTest()
        {
            GenericCache <int, int> cache = new GenericCache <int, int>();

            cache.Add(1, 1001);
            cache.Add(2, 1002);
            int result;

            Assert.IsTrue(cache.TryGetValue(1, out result));
            Assert.AreEqual <int>(1001, result);
            Assert.IsFalse(cache.TryGetValue(3, out result));
        }
Ejemplo n.º 9
0
        public void should_read_from_cache_when_no_update_in_po_file()
        {
            var parser = new Mock<IPoFileParser>();
            var expectedI18NMessages = new[] { new I18NMessage("translation key", "translation key") };
            var localeEnUsMessagesPo = Path.Combine(TestHelper.GetRuntimePath(),"locale\\en-US\\messages.po");
            parser.Setup(p => p.Parse(localeEnUsMessagesPo)).Returns(expectedI18NMessages.ToDictionary(d=> d.MsgId));

            var i18NMessagesCache = new GenericCache<IDictionary<string, I18NMessage>>();
            var actualI18NMessages = i18NMessagesCache.Get("en-US", () => parser.Object.Parse(localeEnUsMessagesPo));

            VerifyResult(expectedI18NMessages, actualI18NMessages);
        }
 public void TestSetUp()
 {
     _primaryReadRepo   = new Mock <IReadRepository>(MockBehavior.Strict);
     _secondaryReadRepo = new Mock <IReadRepository>(MockBehavior.Strict);
     _primaryWriteRepo  = new Mock <IWriteRepository>(MockBehavior.Strict);
     _cache             = new GenericCache <Guid, Value, IReadRepository, IWriteRepository>
                              (_primaryReadRepo.Object,
                              _secondaryReadRepo.Object,
                              _primaryWriteRepo.Object,
                              (repo, k) => repo.GetValue(k),
                              (repo, k, v) => repo.SetValue(k, v));
 }
Ejemplo n.º 11
0
        public void CacheTest()
        {
            var people = new People()
            {
                Id = 1, Name = "a"
            };

            GenericCache <People> .GetOrSet(() => people);

            GenericCache <People> .Set(people);

            GenericCache <People> .Get();
        }
Ejemplo n.º 12
0
        public void should_return_correct_translation_value_given_correct_key()
        {
            var parser = new Mock<IPoFileParser>();
            var expectedI18NMessages = new[] { new I18NMessage("translation key", "translation vlaue") };
            var localeEnUsMessagesPo = Path.Combine(TestHelper.GetRuntimePath(), "locale\\en-US\\messages.po");
            parser.Setup(p =>p.Parse(localeEnUsMessagesPo)).Returns(expectedI18NMessages.ToDictionary(d => d.MsgId));

            var i18NMessagesCache = new GenericCache<IDictionary<string, I18NMessage>>();
            var result = new LocalizingService(i18NMessagesCache, TestHelper.GetRuntimePath(), parser.Object)
                .GetText("translation key", new []{"en-US"});

            Assert.Equal("translation vlaue", result);
        }
Ejemplo n.º 13
0
        static ConfigurationBroker()
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            _cache_ = new GenericCache <Type, object>();
            foreach (ConfigurationSectionGroup group in config.SectionGroups)
            {
                if (@group is IConfigurationSource)
                {
                    (@group as IConfigurationSource).Load();
                }
            }
        }
        /// <inheritdoc />
        public DBResult <GenericCache> CacheObject(object cacheObject, string hdid, string domain, int expires, bool commit = true)
        {
            string       json         = JsonSerializer.Serialize(cacheObject, cacheObject.GetType());
            JsonDocument jsonDoc      = JsonDocument.Parse(json);
            GenericCache genericCache = new GenericCache()
            {
                HdId           = hdid,
                Domain         = domain,
                JSON           = jsonDoc,
                JSONType       = cacheObject.GetType().AssemblyQualifiedName,
                ExpiryDateTime = DateTime.UtcNow.AddMinutes(expires),
            };

            return(this.AddCacheObject(genericCache, commit));
        }
Ejemplo n.º 15
0
        public void GenericCacheTest()
        {
            var cacheHelper = new GenericCache <string, string>();

            cacheHelper.Add("hello", "world");

            Assert.AreEqual <int>(1, cacheHelper.Count);
            Assert.AreEqual <bool>(true, cacheHelper.ContainsKey("hello"));
            Assert.AreEqual <bool>(false, cacheHelper.ContainsKey("hi"));

            var val = "";

            cacheHelper.TryGetValue("hello", out val);
            Assert.AreEqual <string>("world", val);

            cacheHelper.Clear();
            Assert.AreEqual <int>(0, cacheHelper.Count);
        }
        /// <inheritdoc />
        public DBResult <GenericCache> AddCacheObject(GenericCache cacheObject, bool commit = true)
        {
            this.logger.LogTrace("Adding GenericCache object to DB...");
            DBResult <GenericCache> result = new DBResult <GenericCache>()
            {
                Payload = cacheObject,
                Status  = DBStatusCode.Deferred,
            };
            GenericCache dbCacheItem = this.dbContext.GenericCache
                                       .Where(p => p.HdId == cacheObject.HdId && p.Domain == cacheObject.Domain)
                                       .OrderByDescending(o => o.ExpiryDateTime)
                                       .FirstOrDefault();

            if (dbCacheItem == null)
            {
                this.dbContext.GenericCache.Add(cacheObject);
            }
            else
            {
                dbCacheItem.ExpiryDateTime = cacheObject.ExpiryDateTime;
                dbCacheItem.JSON           = cacheObject.JSON;
                dbCacheItem.JSONType       = cacheObject.JSONType;
                this.dbContext.GenericCache.Update(cacheObject);
            }

            if (commit)
            {
                try
                {
                    this.dbContext.SaveChanges();
                    result.Status = DBStatusCode.Created;
                }
                catch (DbUpdateException e)
                {
                    this.dbContext.Entry(cacheObject).State = EntityState.Detached;
                    this.logger.LogInformation($"Unable to save cache item to DB {(e.InnerException != null ? e.InnerException.Message : e.Message)}");
                    result.Status  = DBStatusCode.Error;
                    result.Message = e.Message;
                }
            }

            this.logger.LogDebug($"Finished adding Cache object in DB with result {result.Status}");
            return(result);
        }
Ejemplo n.º 17
0
        static void Main(string[] args)
        {
            //自定义缓存

            var count = 0;

            GenericCache.AddCache <string>("string_key", "cache", 10);
            GenericCache.RemoveCache(m => m == "string_key");
            GenericCache.RemoveCache("string_key");

            //GenericCache.AddCache<int>("int_key", 123456789, 10);
            //for (int i = 0; i < 100; i++)
            //{
            //    Task.Run(() =>
            //    {

            //        var data = GenericCache.GetCache<string>("string_key");
            //        var data2 = GenericCache.GetCache<int>("int_key");
            //        Console.WriteLine("第{0}次数据:{1}-------{2}", ++count, data, data2);
            //        GenericCache.RemoveCache("string_key");
            //        GenericCache.RemoveCache(m => m == "string_key");
            //        Thread.Sleep(1000);
            //    });
            //}

            //GenericCache.AddCache<Student>("Student_Id=1", new Student { Id = 1, Age = 20, BrithDay = DateTime.Parse("1991/01/01"), Name = "Jack", Sex = "M" }, 5);

            GenericCache.AddCache <string>("Student_Id=1", "123", 5);
            GenericCache.AddCache <int>("Student_Id=12", 123, 5);
            var stu = GenericCache.GetCache <string>("Student_Id=1");

            Console.WriteLine("Data in Cache Value is {0}", stu);

            Thread.Sleep(1000 * 12);
            var stu2 = GenericCache.GetCache <string>("Student_Id=1");

            Console.WriteLine("Data in Cache Value is {0}", stu2);

            Console.ReadKey();
        }
Ejemplo n.º 18
0
        private static void SimpleValidation()
        {
            // Create cache
            GenericCache <long, string> toStringCache = new GenericCache <long, string>(
                CacheFactory.Build <string>(
                    settings => settings
                    .WithProtoBufSerializer()
                    .WithSQLiteCacheHandle(new SQLiteCacheHandleAdditionalConfiguration {
                DatabaseFilePath = "MyDatabase.sqlite"
            })
                    .Build()));

            // Initial state
            toStringCache.Exists(1).Should().BeFalse();

            // Add
            toStringCache.Add(1, "1").Should().BeTrue();
            toStringCache.Exists(1).Should().BeTrue();

            // Get
            toStringCache.Get(1).Should().Be("1");
        }
Ejemplo n.º 19
0
        public MainWindow()
        {
            InitializeComponent();
            int id = 6;
            {
                var company = SimpleFactory.CreatDataReaderHelper().Read <CompanyModel>(id);
                var user    = GenericCache <DataReaderHelper> .GetCache().Read <UserModel>(id);

                var countCompany = SimpleFactory.CreatDataReaderHelper().INSERT <CompanyModel>(company.FirstOrDefault());
                var countUser    = GenericCache <DataReaderHelper> .GetCache().INSERT <UserModel>(user.FirstOrDefault());

                //var tempCompany = company.FirstOrDefault();
                //tempCompany.Address = "修改111";
                //var tempUser = user.FirstOrDefault();
                //tempUser.Remark = "修改111";

                //countCompany = SimpleFactory.CreatDataReaderHelper().Update<CompanyModel>(tempCompany);
                //countUser = GenericCache<DataReaderHelper>.GetCache().Update<UserModel>(tempUser);

                //    countCompany =  SimpleFactory.CreatDataReaderHelper().Delete<CompanyModel>(id);
                //    countUser = GenericCache<DataReaderHelper>.GetCache().Delete<UserModel>(id);
            }
        }
Ejemplo n.º 20
0
 public DALIdentities()
 {
     _PSKIdentities = new GenericCache<string, PSKIdentity>(1000);
     SetupNotification(COLLECTION_NAME, new NotificationEventHandler(OnNotification));
 }
Ejemplo n.º 21
0
 public DALSubscriptions()
 {
     _Subscriptions = new GenericCache <Guid, Subscription>(1000);
     SetupNotification(COLLECTION_NAME, new NotificationEventHandler(OnNotification));
 }
Ejemplo n.º 22
0
 public DALAccessKeys()
 {
     _AccessKeys = new GenericCache <string, AccessKey>(1000);
     SetupNotification("AccessKey", new NotificationEventHandler(OnNotification));
 }
Ejemplo n.º 23
0
 public DALIdentities()
 {
     _PSKIdentities = new GenericCache <string, PSKIdentity>(1000);
     SetupNotification(COLLECTION_NAME, new NotificationEventHandler(OnNotification));
 }
Ejemplo n.º 24
0
 public DataTableCache(TimeSpan maxAge)
 {
     genericCache = new GenericCache(maxAge);
 }
Ejemplo n.º 25
0
 public DALAccessKeys()
 {
     _AccessKeys = new GenericCache<string, AccessKey>(1000);
     SetupNotification("AccessKey", new NotificationEventHandler(OnNotification));
 }
Ejemplo n.º 26
0
 public DataTableCache(TimeSpan maxAge)
 {
     genericCache = new GenericCache(maxAge);
 }
Ejemplo n.º 27
0
 internal LocalizingService(GenericCache<IDictionary<string, I18NMessage>> genericCache, string localePath, IPoFileParser poFileParse)
 {
     this.genericCache = genericCache;
     this.localePath = localePath;
     this.poFileParse = poFileParse;
 }
Ejemplo n.º 28
0
        private static void PerformanceProfiling()
        {
            // Create cache
            var sqliteConfig = new SQLiteCacheHandleAdditionalConfiguration
            {
                DatabaseFilePath = "MyDatabase2.sqlite"
            };

            using ICacheManager <int> cacheManager = CacheFactory.Build <int>(
                      settings =>
            {
                settings
                .WithProtoBufSerializer(
                    new RecyclableMemoryStreamManager())         // TODO: Even the memory stream objects is causing perf problems, since it's in the tight loop', is there a way to pool those too?
                .WithSQLiteCacheHandle(sqliteConfig)
                .EnableStatistics()
                .Build();
            });
            using CancellationTokenSource cts = new CancellationTokenSource();
            Task.Run(
                async() =>
            {
                while (!cts.Token.IsCancellationRequested)
                {
                    await Task.Delay(100);

                    var stats = cacheManager.CacheHandles.First().Stats;
                    Console.WriteLine(
                        string.Format(
                            "Items: {0}, Hits: {1}, Miss: {2}, Remove: {3}, ClearRegion: {4}, Clear: {5}, Adds: {6}, Puts: {7}, Gets: {8}",
                            stats.GetStatistic(CacheStatsCounterType.Items),
                            stats.GetStatistic(CacheStatsCounterType.Hits),
                            stats.GetStatistic(CacheStatsCounterType.Misses),
                            stats.GetStatistic(CacheStatsCounterType.RemoveCalls),
                            stats.GetStatistic(CacheStatsCounterType.ClearRegionCalls),
                            stats.GetStatistic(CacheStatsCounterType.ClearCalls),
                            stats.GetStatistic(CacheStatsCounterType.AddCalls),
                            stats.GetStatistic(CacheStatsCounterType.PutCalls),
                            stats.GetStatistic(CacheStatsCounterType.GetCalls)
                            ));
                }
            });
            using GenericCache <Guid, int> toStringCache = new GenericCache <Guid, int>(cacheManager);

            toStringCache.Clear();

            // Performance profiling
            var st = Stopwatch.StartNew();

            try
            {
                // Use a transaction to avoid going to disk for EACH operation
                // TODO: Better/more ephemeral/auto ways to do this?
                using (var tr = sqliteConfig.GetBeginTransactionMethod()())
                {
                    for (int i = 0; i < 28000; i++)
                    {
                        Guid newGuid = Guid.NewGuid();
                        toStringCache[newGuid] = i;

                        var cacheItemIfExists = toStringCache.GetCacheItem(newGuid);
                        cacheItemIfExists.Should().NotBeNull("should exist");
                        cacheItemIfExists.Value.value.Should().Be(i);
                    }

                    tr.Commit();
                    tr.Dispose();
                }
            }
            finally
            {
                Console.WriteLine(st.Elapsed);
            }
        }
Ejemplo n.º 29
0
 public DALSubscriptions()
 {
     _Subscriptions = new GenericCache<Guid, Subscription>(1000);
     SetupNotification(COLLECTION_NAME, new NotificationEventHandler(OnNotification));
 }
Ejemplo n.º 30
0
        public int PrecacheGeneric(string name)
        {
            var(added, resource) = GenericCache.TryAdd(name, PrecachingAllowed, () => EngineFuncs.pfnPrecacheGeneric(StringPool.GetPooledString(name)));

            return(resource?.Index ?? 0);
        }
Ejemplo n.º 31
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public PublicResult <PagedQueryArticles> PagedQueryArticles(PagedQueryArticleDto dto)
        {
            var page     = dto.Page ?? 1;
            var pageSize = dto.PageSize ?? 20;

            ArticleModel model = null;

            using (var client = DbFactory.CreateClient())
            {
                model = client.Queryable <ArticleModel>().InSingle(dto.ArticleModelId);
            }

            if (model == null)
            {
                return(Error("找不到文章模型"));
            }

            //设置字段
            var articleProperties = GenericCache <ArticleTypeInfo>
                                    .GetOrSet(() => new ArticleTypeInfo { PropertyInfos = typeof(Article).GetProperties() })
                                    .PropertyInfos;

            var configs      = JsonConvert.DeserializeObject <List <ArticleConfiguration> >(model.Configuration);
            var selectFields = configs.Where(it => it.IsEnable && it.IsShowedInList)
                               .Select(it =>
            {
                var sugarColumn = articleProperties
                                  .FirstOrDefault(x => x.Name.Equals(it.FiledName, StringComparison.OrdinalIgnoreCase))
                                  ?.GetCustomAttribute <SugarColumn>();
                return(sugarColumn == null ? it.FiledName : sugarColumn.ColumnName);
            }).ToArray().Join(",");

            selectFields += selectFields.IsNullOrEmpty() ? "id,category_id" : ",id,category_id";

            using (var client = DbFactory.CreateClient())
            {
                var total = 0;

                var query = client.Queryable <Article>()
                            .Where(it => it.ArticleTypeId == dto.ArticleModelId);

                if (dto.CategoryId > 0)
                {
                    var queryChildrenIdsByParentIdResult = _categoryService.QueryChildrenIdsByParentId(dto.CategoryId, true);
                    if (queryChildrenIdsByParentIdResult.Code == 0 &&
                        queryChildrenIdsByParentIdResult.Data != null &&
                        queryChildrenIdsByParentIdResult.Data.Any())
                    {
                        query = query.Where(it => queryChildrenIdsByParentIdResult.Data.Contains(it.CategoryId.Value));
                    }
                }

                query = query.Select(selectFields);

                var list = query
                           .OrderBy("id DESC")
                           .ToPageList(page, pageSize, ref total);

                return(new PagedQueryArticles()
                {
                    List = list.Select(it => new QueryArticleItem
                    {
                        Id = it.Id,
                        CategoryId = it.CategoryId,
                        Title = it.Title,
                        SubTitle = it.SubTitle,
                        TitleColor = it.TitleColor,
                        TitleBold = it.TitleBold,
                        Summary = it.Summary,
                        Content = it.Content,
                        Tags = it.Tags,
                        ThumbImage = it.ThumbImage.GetFullPath(),
                        Video = it.Video,
                        Source = it.Source,
                        Author = it.Author,
                        Hits = it.Hits,
                        Addtime = it.Addtime,
                        OrderIndex = it.OrderIndex,
                        IsTop = it.IsTop,
                        IsRecommend = it.IsRecommend,
                        SeoTitle = it.SeoTitle,
                        SeoKeyword = it.SeoKeyword,
                        SeoDescription = it.SeoDescription,
                        String1 = it.String1,
                        String2 = it.String2,
                        String3 = it.String3,
                        String4 = it.String4,
                        Int1 = it.Int1,
                        Int2 = it.Int2,
                        Int3 = it.Int3,
                        Int4 = it.Int4,
                        Decimal1 = it.Decimal1,
                        Decimal2 = it.Decimal2,
                        Decimal3 = it.Decimal3,
                        Decimal4 = it.Decimal4,
                        Datetime1 = it.Datetime1,
                        Datetime2 = it.Datetime2,
                        Datetime3 = it.Datetime3,
                        Datetime4 = it.Datetime4,
                        Bool1 = it.Bool1,
                        Bool2 = it.Bool2,
                        Bool3 = it.Bool3,
                        Bool4 = it.Bool4,
                        Text1 = it.Text1,
                        Text2 = it.Text2,
                        Text3 = it.Text3,
                        Text4 = it.Text4
                    }).ToList(),
                    Page = page,
                    PageSize = pageSize,
                    TotalCount = total
                });
            }
        }