示例#1
0
        public List <string> GetOpinionTypes()
        {
            var res = new List <string>();

            var key = "as_opinion_types";

            if (CacheManager.EnableCaching && CacheManager.Cache[key] != null)
            {
                res = (List <string>)CacheManager.Cache[key];
            }
            else
            {
                try
                {
                    res = db.GetOpinions().Select(x => x.type).Distinct().OrderBy(x => x).ToList();
                    CacheManager.CacheData(key, res);
                }
                catch (Exception ex)
                {
                    Debug.LogError(ex);
                }
            }
            return(res);
        }