コード例 #1
0
        public IActionResult GetCacheReorderColumns()
        {
            ConfigUserTable configUserTable = new ConfigUserTable();
            string          optionTableName = Enum.GetName(typeof(eTablesType), 0);

            optionTableName = User.Identity.Name + "--" + optionTableName;
            var x = _memoryCache.Get(optionTableName);

            if (_memoryCache.TryGetValue(optionTableName, out configUserTable))
            {
                return(Ok(new { success = true, response = configUserTable }));
            }
            return(Ok(new { success = false, response = "" }));
        }
コード例 #2
0
        public IActionResult SetCacheReorderColumns(int[] order, eTablesType etype)
        {
            var cacheEntryOptions = new MemoryCacheEntryOptions()
                                    .SetSlidingExpiration(TimeSpan.FromDays(30));

            ConfigUserTable configUserTable = new ConfigUserTable();

            configUserTable.User            = User.Identity.Name;
            configUserTable.OrderColumTable = order;
            configUserTable.TablesType      = etype;
            string optionTableName = Enum.GetName(typeof(eTablesType), etype);

            optionTableName = User.Identity.Name + "--" + optionTableName;
            _memoryCache.Set(optionTableName, configUserTable, cacheEntryOptions);
            return(Ok(new { success = true, response = true }));
        }